Skip to content

Commit 4ed7957

Browse files
authored
change proxy mode site lookup url (#2886)
1 parent 31bcd1a commit 4ed7957

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/gitbook/src/middleware.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ async function lookupSiteInSingleMode(url: URL): Promise<LookupResult> {
433433
* GITBOOK_MODE=proxy
434434
* When proxying a site on a different base URL.
435435
*/
436-
async function lookupSiteInProxy(request: NextRequest, url: URL): Promise<LookupResult> {
436+
async function lookupSiteInProxy(request: NextRequest, _url: URL): Promise<LookupResult> {
437437
const rawSiteUrl = request.headers.get('x-gitbook-site-url');
438438
if (!rawSiteUrl) {
439439
throw new Error(
@@ -442,8 +442,6 @@ async function lookupSiteInProxy(request: NextRequest, url: URL): Promise<Lookup
442442
}
443443

444444
const siteUrl = new URL(rawSiteUrl);
445-
siteUrl.pathname = joinPath(siteUrl.pathname, url.pathname);
446-
447445
return await lookupSiteInMultiMode(request, siteUrl);
448446
}
449447

0 commit comments

Comments
 (0)