Skip to content

Commit

Permalink
Fix: add 'accept' header to API request for JSON response
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrwitek committed Nov 8, 2024
1 parent ddcd183 commit a12e0f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/api/exchange/[[...params]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const handler: NextApiHandler = async (req, res) => {
}

const newUrl = urlCreator(req.url, parseResult.data, oneInchApiUrl)
const headers = { [AUTH_HEADER_KEY]: 'Bearer ' + oneInchApiKey }
const headers = { [AUTH_HEADER_KEY]: 'Bearer ' + oneInchApiKey, accept: 'application/json' }
// fetch data from 1inch api
const response = await fetch(newUrl, { headers })
// pass the response from 1inch api to the client
Expand Down

0 comments on commit a12e0f1

Please sign in to comment.