Skip to content

Commit

Permalink
Fix incompatibility with New Relic (#351)
Browse files Browse the repository at this point in the history
Co-authored-by: Seth Holladay <me@seth-holladay.com>
  • Loading branch information
lukeupup and sholladay committed May 28, 2021
1 parent 5164ab7 commit 5f3c315
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@types/node-fetch": "^2.5.10",
"@types/pify": "^5.0.0",
"abort-controller": "^3.0.0",
"ava": "^3.15.0",
"ava": "^4.0.0-alpha.2",
"body-parser": "^1.19.0",
"busboy": "^0.3.1",
"del-cli": "^3.0.1",
Expand Down Expand Up @@ -87,16 +87,9 @@
}
},
"ava": {
"files": [
"test/*"
],
"require": [
"./test/_require.ts"
],
"nonSemVerExperiments": {
"configurableModuleFormat": true,
"nextGenConfig": true
},
"extensions": {
"ts": "module"
},
Expand Down
3 changes: 2 additions & 1 deletion source/core/Ky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export class Ky {
throw new RangeError(`The \`timeout\` option cannot be greater than ${maxSafeTimeout}`);
}

await delay(1);
// Delay the fetch so that body method shortcuts can set the Accept header
await Promise.resolve();
let response = await ky._fetch();

for (const hook of ky._options.hooks.afterResponse) {
Expand Down

0 comments on commit 5f3c315

Please sign in to comment.