pax_global_header00006660000000000000000000000064140165114630014513gustar00rootroot0000000000000052 comment=8f48ca686f9564bf52704e0e4b410ca970b17031 fetch-3.6.2/000077500000000000000000000000001401651146300126145ustar00rootroot00000000000000fetch-3.6.2/.eslintignore000066400000000000000000000000251401651146300153140ustar00rootroot00000000000000node_modules dist/** fetch-3.6.2/.eslintrc.json000066400000000000000000000014561401651146300154160ustar00rootroot00000000000000{ "parserOptions": { "ecmaVersion": 2015, "sourceType": "module" }, "globals": { "WHATWGFetch": true, "ArrayBuffer": true, "DataView": true, "Promise": true, "Symbol": true, "Uint8Array": true, "globalThis": true }, "extends": [ "plugin:github/browser" ], "rules": { "object-shorthand": "off" }, "overrides": [ { "files": ["test/*.js"], "env": { "browser": true, "mocha": true }, "globals": { "assert": true, "chai": true, "FileReaderSync": true, "Mocha": true } }, { "files": ["test/{karma,server}*.js"], "env": { "node": true } }, { "files": ["test/worker.js"], "env": { "worker": true } } ] } fetch-3.6.2/.github/000077500000000000000000000000001401651146300141545ustar00rootroot00000000000000fetch-3.6.2/.github/workflows/000077500000000000000000000000001401651146300162115ustar00rootroot00000000000000fetch-3.6.2/.github/workflows/lock.yml000066400000000000000000000003751401651146300176710ustar00rootroot00000000000000name: 'Lock threads' on: schedule: - cron: '0 0 * * *' jobs: lock: runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@v2 with: github-token: ${{ github.token }} issue-lock-inactive-days: '180' fetch-3.6.2/.github/workflows/node.js.yml000066400000000000000000000013331401651146300202740ustar00rootroot00000000000000# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Node.js CI on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [10.x, 12.x, 14.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - run: npm i - run: npm run build --if-present - run: npm test fetch-3.6.2/.gitignore000066400000000000000000000001361401651146300146040ustar00rootroot00000000000000.env package-lock.json dist/ bower_components/ node_modules/ sauce_connect/ sauce_connect.log fetch-3.6.2/.npmignore000066400000000000000000000001301401651146300146050ustar00rootroot00000000000000.env package-lock.json bower_components/ node_modules/ sauce_connect/ sauce_connect.log fetch-3.6.2/CODE_OF_CONDUCT.md000066400000000000000000000062301401651146300154140ustar00rootroot00000000000000# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at opensource+fetch@github.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ fetch-3.6.2/CONTRIBUTING.md000066400000000000000000000044511401651146300150510ustar00rootroot00000000000000# Contributing Thank you for your interest in contributing to our `fetch` polyfill! Note that we only accept features that are also described in the official [fetch specification][]. However, the aim of this project is not to implement the complete specification; just the parts that are feasible to emulate using XMLHttpRequest. See [Caveats][] for some examples of features that we are unlikely to implement. Contributions to this project are [released][tos] to the public under the [project's open source license](LICENSE). ## Running tests Running `npm test` will: 1. Build the `dist/` files; 1. Run the test suite in headless Chrome & Firefox; 1. Run the same test suite in Web Worker mode. When editing tests or implementation, keep `npm run karma` running: - You can connect additional browsers by navigating to `http://localhost:9876/`; - Changes to [test.js](test/test.js) will automatically re-run the tests in all connected browsers; - When changing [fetch.js](fetch.js), re-run tests by executing `make`; - Re-run specific tests with `./node_modules/.bin/karma run -- --grep=`. ## Submitting a pull request 1. [Fork][fork] and clone the repository; 1. Create a new branch: `git checkout -b my-branch-name`; 1. Make your change, push to your fork and [submit a pull request][pr]; 1. Pat your self on the back and wait for your pull request to be reviewed. Here are a few things you can do that will increase the likelihood of your pull request being accepted: - Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. - Write a [good commit message][]. ## Resources - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) - [GitHub Help](https://help.github.com) [fetch specification]: https://fetch.spec.whatwg.org [tos]: https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license [fork]: https://github.com/github/fetch/fork [pr]: https://github.com/github/fetch/compare [good commit message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html [caveats]: https://github.github.io/fetch/#caveats fetch-3.6.2/LICENSE000066400000000000000000000020451401651146300136220ustar00rootroot00000000000000Copyright (c) 2014-2016 GitHub, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. fetch-3.6.2/Makefile000066400000000000000000000006511401651146300142560ustar00rootroot00000000000000test: lint dist/fetch.umd.js lint: node_modules/ ./node_modules/.bin/eslint --report-unused-disable-directives *.js test/*.js dist/fetch.umd.js: fetch.js rollup.config.js node_modules/ ./node_modules/.bin/rollup -c dist/fetch.umd.js.flow: fetch.js.flow cp $< $@ node_modules/: npm install clean: rm -rf ./bower_components ./node_modules ./dist .PHONY: clean lint test make dist/fetch.umd.js dist/fetch.umd.js.flow fetch-3.6.2/README.md000066400000000000000000000256561401651146300141110ustar00rootroot00000000000000# window.fetch polyfill The `fetch()` function is a Promise-based mechanism for programmatically making web requests in the browser. This project is a polyfill that implements a subset of the standard [Fetch specification][], enough to make `fetch` a viable replacement for most uses of XMLHttpRequest in traditional web applications. ## Table of Contents * [Read this first](#read-this-first) * [Installation](#installation) * [Usage](#usage) * [Importing](#importing) * [HTML](#html) * [JSON](#json) * [Response metadata](#response-metadata) * [Post form](#post-form) * [Post JSON](#post-json) * [File upload](#file-upload) * [Caveats](#caveats) * [Handling HTTP error statuses](#handling-http-error-statuses) * [Sending cookies](#sending-cookies) * [Receiving cookies](#receiving-cookies) * [Redirect modes](#redirect-modes) * [Obtaining the Response URL](#obtaining-the-response-url) * [Aborting requests](#aborting-requests) * [Browser Support](#browser-support) ## Read this first * If you believe you found a bug with how `fetch` behaves in your browser, please **don't open an issue in this repository** unless you are testing in an old version of a browser that doesn't support `window.fetch` natively. Make sure you read this _entire_ readme, especially the [Caveats](#caveats) section, as there's probably a known work-around for an issue you've found. This project is a _polyfill_, and since all modern browsers now implement the `fetch` function natively, **no code from this project** actually takes any effect there. See [Browser support](#browser-support) for detailed information. * If you have trouble **making a request to another domain** (a different subdomain or port number also constitutes another domain), please familiarize yourself with all the intricacies and limitations of [CORS][] requests. Because CORS requires participation of the server by implementing specific HTTP response headers, it is often nontrivial to set up or debug. CORS is exclusively handled by the browser's internal mechanisms which this polyfill cannot influence. * This project **doesn't work under Node.js environments**. It's meant for web browsers only. You should ensure that your application doesn't try to package and run this on the server. * If you have an idea for a new feature of `fetch`, **submit your feature requests** to the [specification's repository](https://github.com/whatwg/fetch/issues). We only add features and APIs that are part of the [Fetch specification][]. ## Installation ``` npm install whatwg-fetch --save ``` As an alternative to using npm, you can obtain `fetch.umd.js` from the [Releases][] section. The UMD distribution is compatible with AMD and CommonJS module loaders, as well as loading directly into a page via `