Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

cyclimse
Copy link
Collaborator

@cyclimse cyclimse commented Jul 12, 2024

Summary

What's changed?

  • Remove the .encode("utf-8") when creating a body from a base64 response

Why do we need this?

  • There is a bug when decoding base64, the binary body was encoded in utf-8 which of course was failing with true binary data
  • While this code was unit tested, unfortunately, it was tested with a dummy utf-8 string turned into base64, which of course did not trigger the bug as it was a valid utf-8

How have you tested it?

  • Fixed unit test to use a non-utf8 binary output
  • Tested locally by returning an image ✅

Checklist

  • I have reviewed this myself
  • There is a unit test covering every change in this PR
  • I have updated the relevant documentation

Details

@cyclimse cyclimse self-assigned this Jul 12, 2024
@cyclimse cyclimse requested review from Bemilie and norbjd July 12, 2024 21:04
@norbjd norbjd merged commit 493390d into main Jul 15, 2024
@norbjd norbjd deleted the fix/issue-with-base64-encoded-data branch July 15, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants