Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
mcantor opened this Issue · 7 comments

2 participants

@mcantor

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?

@jakubroztocil

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

@mcantor

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.

@jakubroztocil

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.

@jakubroztocil

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

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

@jakubroztocil

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

@jakubroztocil

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
Something went wrong with that request. Please try again.