httpbin icon indicating copy to clipboard operation
httpbin copied to clipboard

base64 endpoint status 500 with binary data

Open rajsite opened this issue 5 years ago • 2 comments

I want to use httpbin to test different binary response types, in this case having a null value in the middle of a response like the following 8 bytes of hex response:

cb d2 7c 42 00 a9 78 c2

I tried to base64 encode the value to use with the base 64 endpoint (as GET with Accept: application/octet-stream):

http://httpbin.org/base64/y9J8QgCpeMI=

But that results in the following http response showing an error:

Incorrect Base64 data try: SFRUUEJJTiBpcyBhd2Vzb21l

rajsite avatar Feb 11 '20 21:02 rajsite

I have the same problem, when trying to feed a Base64-encoded CRL in DER format to the /base64/ endpoint.

felixfontein avatar Apr 11 '20 13:04 felixfontein

Maybe leaving the .decode("utf-8") away in https://github.com/postmanlabs/httpbin/blob/master/httpbin/core.py#L1309 would fix the problem?

felixfontein avatar Apr 11 '20 13:04 felixfontein