Skip to content

Commit

Permalink
adapt requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Jul 12, 2024
1 parent f7c5e04 commit a94e966
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fetch-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default async function fetchWrapper(
? JSON.stringify(requestOptions.body)
: requestOptions.body;

// Header values must be `string`
const requestHeaders = Object.fromEntries(
Object.entries(requestOptions.headers).map(([name, value]) => [
name,
Expand All @@ -37,7 +38,6 @@ export default async function fetchWrapper(
method: requestOptions.method,
body,
redirect: requestOptions.request?.redirect,
// Header values must be `string`
headers: requestHeaders,
signal: requestOptions.request?.signal,
// duplex must be set if request.body is ReadableStream or Async Iterables.
Expand Down Expand Up @@ -145,7 +145,7 @@ export default async function fetchWrapper(
return octokitResponse;
}

function getResponseData(response: Response) {
async function getResponseData(response: Response): Promise<any> {
const contentType = response.headers.get("content-type");
if (/application\/json/.test(contentType!)) {
return (
Expand Down

0 comments on commit a94e966

Please sign in to comment.