-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from ethanniser/search-race-cond
fix search race cond
- Loading branch information
Showing
2 changed files
with
73 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
import { cookies } from "next/headers" | ||
import { cookies } from "next/headers"; | ||
|
||
export async function GET(request: Request) { | ||
// dump all the request headers, cookies, and body, infinite deep json stringify | ||
const stringifyHeaders = JSON.stringify(Object.fromEntries(request.headers), null, 2) | ||
const cookieStore = (await cookies()).getAll() | ||
const stringifyCookies = JSON.stringify(cookieStore, null, 2) | ||
// dump all the request headers, cookies, and body, infinite deep json stringify | ||
const stringifyHeaders = JSON.stringify( | ||
Object.fromEntries(request.headers), | ||
null, | ||
2, | ||
); | ||
const cookieStore = (await cookies()).getAll(); | ||
const stringifyCookies = JSON.stringify(cookieStore, null, 2); | ||
|
||
console.log("headers", stringifyHeaders) | ||
console.log("cookies", stringifyCookies) | ||
const responseObj = { | ||
headers: stringifyHeaders, | ||
cookies: stringifyCookies, | ||
} | ||
return Response.json(responseObj) | ||
} | ||
console.log("headers", stringifyHeaders); | ||
console.log("cookies", stringifyCookies); | ||
const responseObj = { | ||
headers: stringifyHeaders, | ||
cookies: stringifyCookies, | ||
}; | ||
|
||
return Response.json(responseObj); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters