mccutchen / go-httpbin

A reasonably complete and well-tested golang port of httpbin, with zero dependencies outside the go stdlib.
https://httpbingo.org
MIT License
596 stars 124 forks source link

Emoji string fails to decode #152

Closed bbhtt closed 1 year ago

bbhtt commented 1 year ago

Hello any idea why this string fails to decode?

šŸ™‹, šŸŒ!\nā€¦

It seems to work fine on command line echo "8J+Ziywg8J+MjSEK4oCm"|base64 --decode but https://httpbingo.org/base64/decode/8J+Ziywg8J+MjSEK4oCm returns an error.

I guess it rejects certain encodes?

mccutchen commented 1 year ago

The problem here is that go-httpbin only accepts the URL-safe base64 encoding, though the error does not make that obvious.

Fixing in https://github.com/mccutchen/go-httpbin/pull/153.

mccutchen commented 1 year ago

Fix released in v2.12.0, and deployed to https://httpbingo.org.

Your test case now works as expected:

$ curl 'https://httpbingo.org/base64/decode/8J+Ziywg8J+MjSEK4oCm'
šŸ™‹, šŸŒ!
ā€¦

Thanks for the report @bbhtt!

bbhtt commented 1 year ago

Thanks!