Skip to content

Commit

Permalink
Merge branch 'canary' into eliminate-unnecessary-decodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan-Arrowood committed Mar 18, 2024
2 parents 7c7c6b3 + b39a4d5 commit 23c0c93
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/next/src/server/base-server.ts
Expand Up @@ -889,7 +889,11 @@ export default abstract class Server<ServerOptions extends Options = Options> {
}

const { originalRequest } = req as NodeNextRequest
const isHttps = !!(originalRequest?.socket as TLSSocket)?.encrypted
const xForwardedProto = originalRequest?.headers['x-forwarded-proto']
const isHttps = xForwardedProto
? xForwardedProto === 'https'
: !!(originalRequest?.socket as TLSSocket)?.encrypted

req.headers['x-forwarded-host'] ??= req.headers['host'] ?? this.hostname
req.headers['x-forwarded-port'] ??= this.port
? this.port.toString()
Expand Down

0 comments on commit 23c0c93

Please sign in to comment.