Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

[Bug] Uploading binary files in wrong format #70

Open
pil0t opened this issue Jan 6, 2021 · 1 comment
Open

[Bug] Uploading binary files in wrong format #70

pil0t opened this issue Jan 6, 2021 · 1 comment

Comments

@pil0t
Copy link
Contributor

pil0t commented Jan 6, 2021

Tested on https://upload.wikimedia.org/wikipedia/commons/c/ce/Transparent.gif

Example code for testing:

PUT https://httpbin.org/put

< ./Transparent.gif

> {%
  client.log(response);
%}

Running from Rider (IDE) I have the next response:

...
"data": "data:application/octet-stream;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
...

But if run from restcli :

...
  "data": "GIF89a\u0001\u0000\u0001\u0000\ufffd\u0000\u0000\u0000\u0000\u0000\ufffd\ufffd\ufffd!\ufffd\u0004\u0001\u0000\u0000\u0000\u0000,\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0000\u0000\u0002\u0001D\u0000;",
...
@konikvranik
Copy link
Contributor

the problem is that request body is always handled as an utf8 text. So the transcoding into the utf8 disrupts the binary files.

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

No branches or pull requests

2 participants