Skip to content

Commit 03fb51e

Browse files
authored
Fix allowlist URL check (#107599)
1 parent 07773c5 commit 03fb51e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/server/api/sign-in-with-apple.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ function redirectToCalypso( request, response, next ) {
6969
} );
7070

7171
const isRelativeUrl = originalUrlPath.startsWith( '/' ) && ! originalUrlPath.startsWith( '//' );
72-
if ( ! isRelativeUrl && ! ALLOWED_ORIGINS.includes( originalUrlPath ) ) {
72+
if (
73+
! isRelativeUrl &&
74+
! ALLOWED_ORIGINS.some( ( origin ) => originalUrlPath.startsWith( origin ) )
75+
) {
7376
return next();
7477
}
7578

0 commit comments

Comments
 (0)