Skip to content

Commit

Permalink
feat: support custom request headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ifyour committed Nov 16, 2023
1 parent b7ad82a commit 98f426a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ async function query(
const response = await fetch(config?.proxyEndpoint ?? API_URL, {
headers: {
'Content-Type': 'application/json; charset=utf-8',
...config?.customHeader,
},
method: 'POST',
body: buildRequestBody(params),
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ export type ResponseParams = {

export type Config = {
proxyEndpoint?: string;
customHeader?: Record<string, string>;
};

0 comments on commit 98f426a

Please sign in to comment.