mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 07:35:16 +00:00
Test by passing a x-forwarded-host header
This commit is contained in:
@@ -53,6 +53,9 @@ export async function middleware(request: NextRequest) {
|
||||
console.log(`rendering ${resolved.space} ${resolved.pathname}`);
|
||||
|
||||
const headers = new Headers(request.headers);
|
||||
|
||||
// Pass a x-forwarded-host and origin to ensure Next doesn't block server actions when proxied
|
||||
headers.set('x-forwarded-host', inputURL.host);
|
||||
headers.set('origin', inputURL.origin);
|
||||
headers.set('x-gitbook-token', resolved.apiToken);
|
||||
headers.set('x-gitbook-basepath', joinPath(proxyBasePath, resolved.basePath));
|
||||
|
||||
Reference in New Issue
Block a user