Skip to content

Commit 106cea0

Browse files
authored
Update 1inch API header (#3933)
* Updated 1inch api header and * Added bearer prefix
1 parent cde7c35 commit 106cea0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pages/api/exchange/[[...params]].tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { config } from 'server/config'
44
import { z } from 'zod'
55

66
const ROUTE_NAME = 'exchange'
7-
const AUTH_HEADER_KEY = 'auth-key'
7+
const AUTH_HEADER_KEY = 'Authorization'
88

99
const oneInchSchema = z.object({
1010
apiVersion: z.string(),
@@ -71,7 +71,7 @@ const handler: NextApiHandler = async (req, res) => {
7171
}
7272

7373
const newUrl = urlCreator(req.url, parseResult.data, oneInchApiUrl)
74-
const headers = { [AUTH_HEADER_KEY]: oneInchApiKey }
74+
const headers = { [AUTH_HEADER_KEY]: 'Bearer ' + oneInchApiKey }
7575
// fetch data from 1inch api
7676
const response = await fetch(newUrl, { headers })
7777
// pass the response from 1inch api to the client

0 commit comments

Comments
 (0)