File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
packages/astro/src/core/app Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' astro ' : patch
3+ ---
4+
5+ Update validate-headers to use matchProtocol when parsing protocol
Original file line number Diff line number Diff line change 1- import { matchPattern , type RemotePattern } from '@astrojs/internal-helpers/remote' ;
1+ import { matchPattern , matchProtocol , type RemotePattern } from '@astrojs/internal-helpers/remote' ;
22
33/**
44 * Sanitize a hostname by rejecting any with path separators.
@@ -93,7 +93,7 @@ export function validateForwardedHeaders(
9393 // Validate against allowedDomains patterns
9494 try {
9595 const testUrl = new URL ( `${ forwardedProtocol } ://example.com` ) ;
96- const isAllowed = allowedDomains . some ( ( pattern ) => matchPattern ( testUrl , pattern ) ) ;
96+ const isAllowed = allowedDomains . some ( ( pattern ) => matchProtocol ( testUrl , pattern . protocol ) ) ;
9797 if ( isAllowed ) {
9898 result . protocol = forwardedProtocol ;
9999 }
You can’t perform that action at this time.
0 commit comments