Skip to content

Commit a666604

Browse files
committed
All: Add Vary:X-Forwarded-Proto header
Folows-up 7b0e201.
1 parent 81ad485 commit a666604

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugins/jquery-actions.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
} elseif ( @$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'http' ) {
2424
$_SERVER['HTTPS'] = '0';
2525
}
26+
add_filter( 'wp_headers', function ( $headers ) {
27+
if ( isset( $headers['Vary'] ) ) {
28+
$headers['Vary'] .= ',X-Forwarded-Proto';
29+
} else {
30+
$headers['Vary'] = 'X-Forwarded-Proto';
31+
}
32+
return $headers;
33+
}, 10, 1 );
2634

2735
/**
2836
* Add rel=me link to HTML head for Mastodon domain verification

0 commit comments

Comments
 (0)