We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f03b94 commit 3500de9Copy full SHA for 3500de9
packages/gitbook/openNext/customWorkers/middleware.js
@@ -23,6 +23,7 @@ export default class extends WorkerEntrypoint {
23
`gitbook-open-v2-${this.env.STAGE}="${this.env.WORKER_VERSION_ID}"`
24
);
25
return this.env.DEFAULT_WORKER?.fetch(reqOrResp, {
26
+ redirect: 'manual',
27
cf: {
28
cacheEverything: false,
29
},
@@ -33,6 +34,9 @@ export default class extends WorkerEntrypoint {
33
34
modifiedUrl.hostname = this.env.PREVIEW_HOSTNAME;
35
const nextRequest = new Request(modifiedUrl, reqOrResp);
36
return fetch(nextRequest, {
37
+ // We never want to follow the redirects here.
38
+ // Redirects are supposed to happen from the client.
39
40
41
42
0 commit comments