Socket
Socket
Sign inDemoInstall

whatwg-fetch

Package Overview
Dependencies
0
Maintainers
3
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.6.17 to 3.6.18

8

dist/fetch.umd.js

@@ -547,6 +547,12 @@ (function (global, factory) {

var options = {
status: xhr.status,
statusText: xhr.statusText,
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
};
// This check if specifically for when a user fetches a file locally from the file system
// Only if the status is out of a normal range
if (request.url.startsWith('file://') && (xhr.status < 200 || xhr.status > 599)) {
options.status = 200;
} else {
options.status = xhr.status;
}
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');

@@ -553,0 +559,0 @@ var body = 'response' in xhr ? xhr.response : xhr.responseText;

10

fetch.js

@@ -541,6 +541,12 @@ /* eslint-disable no-prototype-builtins */

var options = {
status: xhr.status,
statusText: xhr.statusText,
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
}
// This check if specifically for when a user fetches a file locally from the file system
// Only if the status is out of a normal range
if (request.url.startsWith('file://') && (xhr.status < 200 || xhr.status > 599)) {
options.status = 200;
} else {
options.status = xhr.status;
}
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')

@@ -636,2 +642,2 @@ var body = 'response' in xhr ? xhr.response : xhr.responseText

g.Response = Response
}
}
{
"name": "whatwg-fetch",
"description": "A window.fetch polyfill.",
"version": "3.6.17",
"version": "3.6.18",
"main": "./dist/fetch.umd.js",

@@ -11,2 +11,3 @@ "module": "./fetch.js",

"abortcontroller-polyfill": "^1.1.9",
"auto-changelog": "^2.4.0",
"chai": "^4.1.2",

@@ -39,4 +40,5 @@ "eslint": "^7.20.0",

"pretest": "make",
"test": "karma start ./test/karma.config.js && karma start ./test/karma-worker.config.js"
"test": "karma start ./test/karma.config.js && karma start ./test/karma-worker.config.js",
"version": "auto-changelog -p && git add CHANGELOG.md"
}
}

@@ -73,5 +73,2 @@ # window.fetch polyfill

For a more comprehensive API reference that this polyfill supports, refer to
https://github.github.io/fetch/.
### Importing

@@ -197,3 +194,3 @@

[`redirect`](#redirect-modes) and
[`cache`](https://github.github.io/fetch/#caveats) directives are ignored.
`cache` directives are ignored.

@@ -200,0 +197,0 @@ * `keepalive` is not supported because it would involve making a synchronous XHR, which is something this project is not willing to do. See [issue #700](https://github.com/github/fetch/issues/700#issuecomment-484188326) for more information.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc