Skip to content

Commit

Permalink
remove node version checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Nov 30, 2023
1 parent cae4ff0 commit ceb5813
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 0 additions & 4 deletions lib/core/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@ class Request {
}

if (util.isFormDataLike(this.body)) {
if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
}

if (!extractBody) {
extractBody = require('../fetch/body.js').extractBody
}
Expand Down
2 changes: 1 addition & 1 deletion lib/core/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,6 @@ module.exports = {
parseRangeHeader,
nodeMajor,
nodeMinor,
nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
nodeHasAutoSelectFamily: true,
safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
}
6 changes: 2 additions & 4 deletions lib/fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const {
const { kHeadersList } = require('../core/symbols')
const EE = require('events')
const { Readable, pipeline } = require('stream')
const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = require('../core/util')
const { addAbortListener, isErrored, isReadable } = require('../core/util')
const { dataURLProcessor, serializeAMimeType } = require('./dataURL')
const { TransformStream } = require('stream/web')
const { getGlobalDispatcher } = require('../global')
Expand Down Expand Up @@ -319,9 +319,7 @@ function finalizeAndReportTiming (response, initiatorType = 'other') {

// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
}
performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
}

// https://fetch.spec.whatwg.org/#abort-fetch
Expand Down

0 comments on commit ceb5813

Please sign in to comment.