Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! fix(@angular/ssr): decode x-forwarded-prefix before validation
  • Loading branch information
alan-agius4 committed Mar 31, 2026
commit 642988a4a7f2ff703e686e757ddb86046935725a
2 changes: 1 addition & 1 deletion packages/angular/ssr/src/utils/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function validateHeaders(request: Request): void {
if (xForwardedPrefix) {
let xForwardedPrefixDecoded: string;
try {
xForwardedPrefixDecoded = decodeURIComponent(xForwardedPrefix);
xForwardedPrefixDecoded = decodeURIComponent(xForwardedPrefix).trim();
} catch (e) {
throw new Error(
'Header "x-forwarded-prefix" contains an invalid value and cannot be decoded.',
Expand Down
2 changes: 2 additions & 0 deletions packages/angular/ssr/test/utils/validation_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ describe('Validation Utils', () => {
'/foo/..\\bar',
'.',
'..',
'%2e',
'%2e%2e/foo',
];

for (const prefix of inputs) {
Expand Down
Loading