Skip to content

Commit

Permalink
refactor: better format
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickJS committed May 10, 2024
1 parent 73f441e commit 7e17f79
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/qwik-city/middleware/node/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ export async function fromNodeHttp(
const nodeRequestHeaders = req.headers;

try {
for (const key in nodeRequestHeaders) {
for (const [key, value] of Object.entries(nodeRequestHeaders)) {
if (invalidHeadersPattern.test(key)) {
continue;
}
const value = nodeRequestHeaders[key];
if (typeof value === 'string') {
requestHeaders.set(key, value);
} else if (Array.isArray(value)) {
Expand Down Expand Up @@ -109,11 +108,10 @@ export async function fromNodeHttp(
res.statusCode = status;

try {
for (const key in headers) {
for (const [key, value] of headers) {
if (invalidHeadersPattern.test(key)) {
continue;
}
const value = headers[key];
res.setHeader(key, value);
}
const cookieHeaders = cookies.headers();
Expand Down

0 comments on commit 7e17f79

Please sign in to comment.