Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
Update route.js
Browse files Browse the repository at this point in the history
  • Loading branch information
uesleibros authored Sep 3, 2024
1 parent 44fb14b commit f7d6819
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/api/debug/test/route.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
export async function POST(request) {
const body = await request.json();
const res = await fetch(body.url, {
method: "GET",
headers: body.headers,
cache: "no-store"
});

const data = res.headers;
return Response.json(data);
const headers = {};
res.headers.forEach((value, key) => {
headers[key] = value;
});

return Response.json(headers);
}

0 comments on commit f7d6819

Please sign in to comment.