Skip to content

Commit a24ef39

Browse files
committed
Fix CSRF check for lax-proto match origin and inputOrigin after removing
protocol when checkOrigin is lax-proto
1 parent bb30d29 commit a24ef39

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/qwik-city/src/middleware/request-handler/resolve-request-handlers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,7 @@ function checkCSRF(requestEv: RequestEvent, laxProto?: 'lax-proto') {
450450
if (
451451
forbidden &&
452452
laxProto &&
453-
origin.startsWith('https://') &&
454-
inputOrigin?.slice(4) === origin.slice(5)
453+
inputOrigin?.replace(/http(s)?/g, '') === origin.replace(/http(s)?/g, '')
455454
) {
456455
forbidden = false;
457456
}

0 commit comments

Comments
 (0)