Skip to content

Commit 777d0cb

Browse files
committed
hopefully fix tests
1 parent 95f7de5 commit 777d0cb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const handle = sequence(
5757
return resolve(event);
5858
},
5959
({ event, resolve }) => {
60-
if (event.request.headers.has('user-agent') === !!event.isSyntheticRequest) {
60+
if (!!event.request.headers.get('x-this-is-a-synthetic-request') !== event.isSyntheticRequest) {
6161
throw new Error('Synthetic requests should have isSyntheticRequest set to true');
6262
}
6363
return resolve(event);
@@ -138,5 +138,7 @@ export async function handleFetch({ request, fetch }) {
138138
);
139139
}
140140

141+
request.headers.set('x-this-is-a-synthetic-request', 'true');
142+
141143
return fetch(request);
142144
}

0 commit comments

Comments
 (0)