alamirault / fftt-api-src

2 stars 1 forks source link

Fix data encoding only for content-type in "text/html; charset=UTF-8" #11

Closed StephSako closed 1 year ago

StephSako commented 1 year ago

Some requests have a different header than others, whose data must be correctly encoded

alamirault commented 1 year ago

Do you have an endpoint example ?

I will add unit test in order to cover this case

StephSako commented 1 year ago

Routes with content-type : "text/html; charset=UTF-8" and accents bugging ("é" into "Sé", "à" into "Ã", "ç" into "ç", ...) :

Routes with content-type : "application/xml;charset=ISO-8859-1" and accents or special chars not bugging, and their data must not be encoded. If some special chars or accents are encoded, they turned into the "?" char. Examples :

alamirault commented 1 year ago

Thank you @StephSako

I added unit tests, and this fix explains a strange behavior I had noticed