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

Closed
mcantor opened this Issue Aug 12, 2012 · 7 comments

Comments

Projects
None yet
2 participants

mcantor commented Aug 12, 2012

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?

Owner

jakubroztocil commented Aug 12, 2012

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

mcantor commented Aug 13, 2012

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.

Owner

jakubroztocil 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.

Owner

jakubroztocil 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.

mcantor commented Aug 13, 2012

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...

Owner

jakubroztocil commented Aug 13, 2012

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

Owner

jakubroztocil commented Sep 21, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment