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

[MRG+1] Fix issue HttpCompressionMiddleware tries to decode HEAD responses #1899 #2008

Merged
merged 3 commits into from Jun 6, 2016
Merged

Conversation

@foromer4
Copy link
Contributor

@foromer4 foromer4 commented May 24, 2016

Not sure if this is required or not, but seems like a good way to start working on this project...

response = response.replace(body = None)
newresponse = self.mw.process_response(request, response, self.spider)
self.assertIs(newresponse, response)
self.assertEquals(response.body, '')

This comment has been minimized.

@eliasdorneles

eliasdorneles May 24, 2016
Member

The tests are failing in Python 3 because '' is not bytes, but a native string (which in Python 3 is the same as unicode object in Python 2).
If you update this to b'' tests should pass.

This comment has been minimized.

@foromer4

foromer4 May 25, 2016
Author Contributor

thank you

@kmike kmike changed the title Fix issue HttpCompressionMiddleware tries to decode HEAD responses #1899 [MRG+1] Fix issue HttpCompressionMiddleware tries to decode HEAD responses #1899 May 27, 2016
@redapple redapple merged commit b7925e4 into scrapy:master Jun 6, 2016
2 checks passed
2 checks passed
codecov/patch 100% of diff hit (target 100%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@redapple
Copy link
Contributor

@redapple redapple commented Jun 6, 2016

Thanks @foromer4

redapple added a commit that referenced this pull request Jul 8, 2016
[backport][1.1] HttpCompressionMiddleware: don't decode HEAD responses (PR #2008)
@redapple redapple added this to the v1.1.1 milestone Jul 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants