Skip to content

Commit

Permalink
fix: preserve setheader value type
Browse files Browse the repository at this point in the history
  • Loading branch information
Hebilicious committed Jul 28, 2023
1 parent 82bdf72 commit 3acf7ed
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/runtime/node/http/_response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,12 @@ export class ServerResponse extends Writable implements http.ServerResponse {
return this;
}

setHeader(
name: string,
value: number | string | ReadonlyArray<string>,
): this {
this._headers[name.toLowerCase()] = value + "";
setHeader(name: string, value: string | string[]): this {
this._headers[name.toLowerCase()] = value;
return this;
}

getHeader(name: string): number | string | string[] | undefined {
getHeader(name: string): string | string[] | undefined {
return this._headers[name.toLowerCase()];
}

Expand Down

0 comments on commit 3acf7ed

Please sign in to comment.