-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Status: CompletedNothing further to be done with this issue. Awaiting to be closed.Nothing further to be done with this issue. Awaiting to be closed.Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone
Description
httpx version:
1.2.6
Current Behavior:
Sometimes, binary body is altered, and decoding base64 body returns unexpected data (who looks to have been pre-encoded as utf-8)
Here is a POC:
$ echo 'https://zc-console.taobao.com/favicon.ico' | httpx -silent -json -irrb | jq .body -j | base64 -d | wc -c
2246
$ curl -s 'https://zc-console.taobao.com/favicon.ico' | wc -c
1863
Note that in this specific case, Content-Type header is set to image/x-icon;charset=GBK, so underlying http library might be automatically trying to encode data, given that charset is specified.
Expected Behavior:
-irrb should always returns a base64 version of the raw, original body's binary content, with no previous encoding
Anything else:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: CompletedNothing further to be done with this issue. Awaiting to be closed.Nothing further to be done with this issue. Awaiting to be closed.Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.Inconsistencies or issues which will cause an issue or problem for users or implementors.