Skip to content

Commit 7b43f24

Browse files
Switch header for incoming protocol (#9837)
* Switch header for incoming protocol * Update policy-doc-surrogate-key
1 parent 877fcca commit 7b43f24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ export function middleware(request: NextRequest) {
228228
// See https://github.com/pantheon-systems/documentation/issues/9791
229229
// for more context.
230230
const siteMachineName = process.env.PANTHEON_SITE_MACHINE_NAME || "documentation-in-nextjs";
231-
const incomingProtocol = request.headers.get('x-proto') || '';
232-
const policyDocSurrogateKey = request.headers.get('policy-doc-surrogate-key') || '';
231+
const incomingProtocol = request.headers.get('x-forwarded-proto') || '';
232+
const policyDocSurrogateKey = request.headers.get('Policy-Doc-Surrogate-Key') || '';
233233
if (incomingProtocol === 'http' && policyDocSurrogateKey) {
234234
url.protocol = "https:";
235235
url.hostname = policyDocSurrogateKey;

0 commit comments

Comments
 (0)