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

Fix the problem with HTTP encoding #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qmm0523
Copy link

@qmm0523 qmm0523 commented Apr 5, 2018

I noticed that the codes set HTTP header 'Accept-Encoding' to 'gzip', but forgot to write code to decompress gzip HTTP packet, so it cause problem(see #133 way is simple,change the 'gzip' to '', then the server will no loger reply you with gzip compressed packets.

I noticed that the codes set HTTP header 'Accept-Encoding' to 'gzip', but forgot to write code to decompress gzip HTTP packet, so it cause problem(see fffonion#133 way is simple,change the 'gzip' to '', then the server will no loger reply you with gzip compressed packets.
@fffonion
Copy link
Owner

Hi, thank you for submitting the PR. Sorry for the delay on my side.
IMHO we would better follow the same request parameter as "official" client. We would keep the gzip header and to detect the response instead. gzip format always starts with 0x1f 0x8b so it can be easy to detect.

@qmm0523
Copy link
Author

qmm0523 commented Apr 10, 2018

Sure, you can use gzip module to deal with these HTTP requests, but change the Accept-Encoding is the fastest way to fix the current problem. I think it's unnecessary that keep every header the same with the official, The web server such as Nginx will deal with encoding and the web application don't care it.

@fffonion
Copy link
Owner

fffonion commented Apr 10, 2018

We shouldn't assume the behavior of xunlei, which is a blackbox to us. Though the codec part is more likely to be done in a generic way and xunlei doesn't check it at all. Besides of that, fastdick server has a history of not respecting accept-encoding when we ask for gzip and it sends plaintext response. I think the better choice here in either way is to detect the response on our side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants