Skip to content

Commit 3f3db08

Browse files
committed
add test
1 parent 9065c8d commit 3f3db08

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/kit/test/apps/basics/src/hooks.server.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ export const handle = sequence(
5656
}
5757
return resolve(event);
5858
},
59+
({ event, resolve }) => {
60+
if (!(event.request.headers.has('user-agent') ^ event.isSyntheticRequest)) {
61+
throw new Error('Synthetic requests should have isSyntheticRequest set to true');
62+
}
63+
return resolve(event);
64+
},
5965
({ event, resolve }) => {
6066
if (event.url.pathname.includes('fetch-credentialed')) {
6167
// Only get the cookie at the test where we know it's set to avoid polluting our logs with (correct) warnings

0 commit comments

Comments
 (0)