Skip to content

Commit 11e6f22

Browse files
committed
log all header
1 parent 59a0e2b commit 11e6f22

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/gitbook-v2/src/middleware.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ function serveErrorResponse(error: Error) {
171171
* URL is taken from the pathname.
172172
*/
173173
function getSiteURLFromRequest(request: NextRequest): URLWithMode | null {
174+
request.headers.forEach((value, key) => {
175+
console.log('header', { key, value });
176+
});
177+
174178
const xGitbookUrl = request.headers.get('x-gitbook-url');
175179
if (xGitbookUrl) {
176180
return {
@@ -200,7 +204,6 @@ function getSiteURLFromRequest(request: NextRequest): URLWithMode | null {
200204
}
201205

202206
const xForwardedHost = request.headers.get('x-forwarded-host');
203-
console.log('x-forwarded-host', xForwardedHost);
204207
// The x-forwarded-host is set by Vercel for all requests
205208
// so we ignore it if the hostname is the same as the instance one.
206209
if (xForwardedHost) {

0 commit comments

Comments
 (0)