Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5028aaf

Browse files
bug #40281 [FrameworkBundle] Allow x-forwarded-prefix trusted header in config (drupol)
This PR was submitted for the 5.x branch but it was merged into the 5.2 branch instead. Discussion ---------- [FrameworkBundle] Allow x-forwarded-prefix trusted header in config | Q | A | ------------- | --- | Branch? | 5.2 (as requested by @nicolas-grekas) | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT Support for `X_FORWARDED_PREFIX` has been added in PR #37734. However, it is impossible to use it because the configuration doesn't allow the `x-forwarded-prefix` value in `framework.yaml`. Commits ------- 95fdd90 Allow x-forwarded-prefix trusted header.
2 parents e98ab92 + 95fdd90 commit 5028aaf

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function getConfigTreeBuilder()
9797
->enumPrototype()
9898
->values([
9999
'forwarded',
100-
'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port',
100+
'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix',
101101
])
102102
->end()
103103
->end()

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2305,6 +2305,7 @@ private function resolveTrustedHeaders(array $headers): int
23052305
case 'x-forwarded-host': $trustedHeaders |= Request::HEADER_X_FORWARDED_HOST; break;
23062306
case 'x-forwarded-proto': $trustedHeaders |= Request::HEADER_X_FORWARDED_PROTO; break;
23072307
case 'x-forwarded-port': $trustedHeaders |= Request::HEADER_X_FORWARDED_PORT; break;
2308+
case 'x-forwarded-prefix': $trustedHeaders |= Request::HEADER_X_FORWARDED_PREFIX; break;
23082309
}
23092310
}
23102311

0 commit comments

Comments
 (0)