Skip to content

Commit

Permalink
fix: headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypyles committed Nov 13, 2024
1 parent dc4d219 commit 3a0762f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/pages/api/me.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export default async function handler(
res: NextApiResponse
) {
try {
const headers = new Headers(req.headers as Record<string, string>);
const headers = new Headers();
headers.set("Authorization", `Bearer ${req.headers.authorization}`);
headers.set("content-type", "application/json");

const response = await fetch(
Expand Down
3 changes: 2 additions & 1 deletion src/pages/api/submit-scrape-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export default async function handler(
if (req.method === "POST") {
const { data } = req.body;

const headers = new Headers(req.headers as Record<string, string>);
const headers = new Headers();
headers.set("Authorization", `Bearer ${req.headers.authorization}`);
headers.set("content-type", "application/json");

try {
Expand Down

0 comments on commit 3a0762f

Please sign in to comment.