We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 656c28c commit 51fcaccCopy full SHA for 51fcacc
2 files changed
examples/proxy/index.js
@@ -19,7 +19,7 @@ async function run () {
19
for (const name of res.getHeaderNames()) {
20
res.removeHeader(name)
21
}
22
- res.writeHead(err.statusCode || 500)
+ res.statusCode = err.statusCode || 500
23
res.end()
24
25
})
examples/proxy/proxy.js
@@ -213,8 +213,9 @@ function getHeaders ({
213
`proto=${socket.encrypted ? 'https' : 'http'}`,
214
`host=${printIp(authority || host || '')}`
215
].join(';'))
216
- } else {
217
- result.push('forwarded', forwarded)
+ } else if (forwarded) {
+ // The forwarded header should not be included in response.
218
+ throw new createError.BadGateway()
219
220
221
if (httpVersion && proxyName) {
0 commit comments