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

Adding option to disable automatic decompression #2661

Merged
merged 11 commits into from
Mar 6, 2020

Conversation

sazzy4o
Copy link
Contributor

@sazzy4o sazzy4o commented Jan 13, 2020

Issue

Sometimes you do not want the response body of an http request automatically decompressed. For example if you are immediately storing response body or are passing response body on to to another service. Closed #2153.

Solution

Add a parameter to config to allow developer to disable automatic decompression

Change summary

  • Add check to see if automatic decompression is disabled in config
  • Add decompress to config typing
  • Update README
  • Fix lint error in unit tests (reverted)
  • Add unit test for new decompress parameter

It has been pointed out that this feature may not be accepted since it only applies to Node.js, but this is an extremely useful feature, so I think it should be included in the official axios package

Please let me know if there is anything that I should change

@sazzy4o sazzy4o changed the title Adding: Ability to disable automatic decompression Adding: Ability to disable automatic decompression #2153 Jan 23, 2020
lib/adapters/http.js Outdated Show resolved Hide resolved
test/unit/adapters/http.js Outdated Show resolved Hide resolved
@chinesedfan chinesedfan changed the title Adding: Ability to disable automatic decompression #2153 Adding option to disable automatic decompression Mar 6, 2020
@chinesedfan chinesedfan merged commit 42eb9df into axios:master Mar 6, 2020
This was referenced Mar 24, 2020
@Fonger
Copy link
Contributor

Fonger commented Apr 19, 2020

When will this feature release? It's documented on README but the latest release 0.19.2 doesn't include this feature.

@svonderohe
Copy link

svonderohe commented Apr 19, 2020

@Fonger I am not sure when the next release will be. This was merged in shortly after the last release. If you want to use this feature now, fork axios and add your fork as the package version for axios in package.json like this:

	"dependencies": {
		"axios": "git://github.com/sazzy4o/axios.git#master"
	}

@axios axios locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to not auto decompress resp
4 participants