Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choose two branches to see what’s #105

Merged
merged 1 commit into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
245 changes: 124 additions & 121 deletions .eslintrc.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: ci

on:
push:
branches: [master]
branches: [master, 'release/*']
pull_request:
branches: [master]
branches: [master, 'release/*']

jobs:
build:
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

### 0.22.0 (October 01, 2021)

Fixes and Functionality:
- Caseless header comparing in HTTP adapter ([#2880](https://github.com/axios/axios/pull/2880))
- Avoid package.json import fixing issues and warnings related to this ([#4041](https://github.com/axios/axios/pull/4041)), ([#4065](https://github.com/axios/axios/pull/4065))
- Fixed cancelToken leakage and added AbortController support ([#3305](https://github.com/axios/axios/pull/3305))
- Updating CI to run on release branches
- Bump follow redirects version
- Fixed default transitional config for custom Axios instance; ([#4052](https://github.com/axios/axios/pull/4052))

Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:

- [Jay](mailto:jasonsaayman@gmail.com)
- [Matt R. Wilson](https://github.com/mastermatt)
- [Xianming Zhong](https://github.com/chinesedfan)
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)

### 0.21.4 (September 6, 2021)

Fixes and Functionality:
Expand Down
25 changes: 20 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line strict
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);

Expand Down Expand Up @@ -37,6 +38,10 @@ module.exports = function(grunt) {
}
},

package2env: {
all: {}
},

usebanner: {
all: {
options: {
Expand Down Expand Up @@ -70,8 +75,8 @@ module.exports = function(grunt) {
src: ['test/unit/**/*.js']
},
options: {
timeout: 30000,
},
timeout: 30000
}
},

watch: {
Expand All @@ -88,20 +93,30 @@ module.exports = function(grunt) {
webpack: require('./webpack.config.js')
});

grunt.registerMultiTask('package2bower', 'Sync package.json to bower.json', function () {
grunt.registerMultiTask('package2bower', 'Sync package.json to bower.json', function() {
var npm = grunt.file.readJSON('package.json');
var bower = grunt.file.readJSON('bower.json');
var fields = this.data.fields || [];

for (var i=0, l=fields.length; i<l; i++) {
for (var i = 0, l = fields.length; i < l; i++) {
var field = fields[i];
bower[field] = npm[field];
}

grunt.file.write('bower.json', JSON.stringify(bower, null, 2));
});

grunt.registerMultiTask('package2env', 'Sync package.json to env.json', function() {
var npm = grunt.file.readJSON('package.json');
grunt.file.write('./lib/env/data.js', [
'module.exports = ',
JSON.stringify({
version: npm.version
}, null, 2),
';'].join(''));
});

grunt.registerTask('test', 'Run the jasmine and mocha tests', ['eslint', 'mochaTest', 'karma:single', 'ts']);
grunt.registerTask('build', 'Run webpack and bundle the source', ['clean', 'webpack']);
grunt.registerTask('version', 'Sync version info for a release', ['usebanner', 'package2bower']);
grunt.registerTask('version', 'Sync version info for a release', ['usebanner', 'package2bower', 'package2env']);
};
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,9 @@ These are the available config options for making requests. Only the `url` is re
cancelToken: new CancelToken(function (cancel) {
}),

// an alternative way to cancel Axios requests using AbortController
signal: new AbortController().signal,

// `decompress` indicates whether or not the response body should be decompressed
// automatically. If set to `true` will also remove the 'content-encoding' header
// from the responses objects of all decompressed responses
Expand Down Expand Up @@ -734,7 +737,20 @@ axios.get('/user/12345', {
cancel();
```

> Note: you can cancel several requests with the same cancel token.
Axios supports AbortController to abort requests in [`fetch API`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#aborting_a_fetch) way:
```js
const controller = new AbortController();

axios.get('/foo/bar', {
signal: controller.signal
}).then(function(response) {
//...
});
// cancel the request
controller.abort()
```

> Note: you can cancel several requests with the same cancel token/abort controller.
> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request.

## Using application/x-www-form-urlencoded format
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "axios",
"main": "./dist/axios.js",
"version": "0.21.4",
"version": "0.22.0",
"homepage": "https://axios-http.com",
"authors": [
"Matt Zabriskie"
Expand Down
Loading