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

"binary data not shown in terminal" appears with HTML response #84

Closed
changemewtf opened this issue Aug 12, 2012 · 7 comments
Closed

"binary data not shown in terminal" appears with HTML response #84

changemewtf opened this issue Aug 12, 2012 · 7 comments
Labels
bug Something isn't working

Comments

@changemewtf
Copy link

Sometimes, HTTPie appears to mistake HTML response data for binary data.

These were the headers that resulted in the unexpected behavior:

HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sun, 12 Aug 2012 22:51:24 GMT
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.0
Cache-Control: private
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Transfer-Encoding: chunked

Perhaps HTTPie is being confused by the Transfer-Encoding header?

@jkbrzt
Copy link
Member

jkbrzt commented Aug 12, 2012

The Transfer-Encoding header shouldn't be a problem. Can you post an example URL where this happens?

@changemewtf
Copy link
Author

Unfortunately it was an internal URL. I'll jimmy with the data a little and see if there's any other apparently relevant info I can add here.

@jkbrzt
Copy link
Member

jkbrzt commented Aug 13, 2012

The binary data detection is based on the presence of \0. From the headers I can see that the response is UTF8-encoded HTML so it normally shouldn't be included. But maybe there are some garbled characters in the response?

In any case, it's not optimal that this happens, even if the data was garbled. I'll see what can be done to improve it.

@jkbrzt
Copy link
Member

jkbrzt commented Aug 13, 2012

Actually, I think I've found the problem. Can you please try the URL with the current development version of HTTPie?

pip install -U https://github.com/jkbr/httpie/tarball/master

Btw, if the content that triggered the false positive isn't sensitive, it would be handy to have it available so that I can create a regression test for this issue.

@changemewtf
Copy link
Author

D'oh... unfortunately the data has changed and I can't reproduce the issue with the stable release version anymore. Will hunt for a bit to see if I can get it to happen again on something similar...

@jkbrzt
Copy link
Member

jkbrzt commented Aug 13, 2012

Please do. I realised that the change I just made is not significant in regards to the issue.

@jkbrzt
Copy link
Member

jkbrzt commented Sep 21, 2012

Closing for now. Please feel free to reopen if the problem persists.

@jkbrzt jkbrzt closed this as completed Sep 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants