express-interceptor icon indicating copy to clipboard operation
express-interceptor copied to clipboard

feat!: Do not parse response data as utf-8

Open dany-fedorov opened this issue 2 years ago • 1 comments

Parsing binary data as utf-8 can cause problems, e.g. pdf file. Parsing as utf-8 replaces bytes that cannot be parsed with replacement character - https://en.wikipedia.org/wiki/Specials_(Unicode_block)#:~:text=The%20replacement%20character%20%EF%BF%BD%20(often,data%20to%20a%20correct%20symbol

For example bytes FB, FC, FD will each be replaced with replacement character which is 3 bytes long and the result will look like this - EF BF BD, EF BF BD, EF BF BD

BREAKING CHANGE: Changes the type of oldBody argument from string to Buffer

dany-fedorov avatar Jan 05 '23 11:01 dany-fedorov

Hey, this is going to need a major version bump if you're ok with this change.

dany-fedorov avatar Jan 05 '23 11:01 dany-fedorov