Skip to content

Commit

Permalink
Fix header names incorrect casing when name and values are the same #709
Browse files Browse the repository at this point in the history
  • Loading branch information
Huachao committed Nov 9, 2020
1 parent 71a502c commit 9b37b7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/utils/httpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,9 @@ export class HttpClient {
private static normalizeHeaderNames<T extends RequestHeaders | ResponseHeaders>(headers: T, rawHeaders: string[]): T {
const headersDic: { [key: string]: string } = rawHeaders.reduce(
(prev, cur) => {
prev[cur.toLowerCase()] = cur;
if (!(cur.toLowerCase() in prev)) {
prev[cur.toLowerCase()] = cur;
}
return prev;
}, {});
const adjustedResponseHeaders = {} as RequestHeaders | ResponseHeaders;
Expand Down
13 changes: 7 additions & 6 deletions styles/vscode.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ a:active {
code {
font-size: var(--vscode-editor-font-size);
font-family: var(--vscode-editor-font-family);
background: inherit;
display: block;
line-height: 1.5;
white-space: pre-wrap;
word-break: break-all;
display: block;
padding: 10px;
}

button {
Expand All @@ -53,12 +60,6 @@ button {
outline-offset: 2px !important;
color: var(--vscode-button-foreground);
background: var(--vscode-button-background);
display: block;
font-size: var(--vscode-editor-font-size);
font-family: var(--vscode-editor-font-family);
line-height: 1.5;
white-space: pre-wrap;
word-break: break-all;
}

button:hover {
Expand Down

0 comments on commit 9b37b7b

Please sign in to comment.