Skip to content

Commit fe77397

Browse files
authored
Make sure internal url always has 200 status code. (vercel#2299)
Even the user set it to something else via custom server api.
1 parent 7c97cdc commit fe77397

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

server/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ export default class Server {
6161
parsedUrl.query = parseQs(parsedUrl.query)
6262
}
6363

64+
res.statusCode = 200
6465
return this.run(req, res, parsedUrl)
65-
.catch((err) => {
66-
if (!this.quiet) console.error(err)
67-
res.statusCode = 500
68-
res.end(STATUS_CODES[500])
69-
})
66+
.catch((err) => {
67+
if (!this.quiet) console.error(err)
68+
res.statusCode = 500
69+
res.end(STATUS_CODES[500])
70+
})
7071
}
7172

7273
getRequestHandler () {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy