Skip to content

Commit

Permalink
Remove redundant response.headers check
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Mar 14, 2023
1 parent ebe33c7 commit abaac0e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/internal/fetchSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ async function* fetchOperation(
response = await (operation.context.fetch || fetch)(url, fetchOptions);
statusNotOk = response.status < 200 || response.status >= 300;

const contentType =
(response.headers && response.headers.get('Content-Type')) || '';
const contentType = response.headers.get('Content-Type') || '';
if (/text\//i.test(contentType)) {
const text = await response.text();
return yield makeErrorResult(operation, new Error(text), response);
Expand Down

0 comments on commit abaac0e

Please sign in to comment.