-
Greetings, thanks for a wonderful initiative! We're trying to proxy to a server that serves content in ISO-8859-1. It's unfortunately not an option to change charset on the application server itself. The proxying part works almost right out of the box using YARP, but we get encoding issues in browser (tested with Chrome) where Norwegian characters as ÆØÅ appears as questionmarks. In our test env we've solved this issue with Nginx with charset module and a single configuration directive in server block:
Using YARP we've tried appending
This actually appends the charset value to the response header (seen in browser) but it doesn't work. We noticed that doing this adds the "charset" part after content-type: text/html separated by comma, like this:
while Nginx does it this way: We actually don't know if the separator has anything to do with the problem we're facing, but maybe worth mentioning. So, the question is: Excuse me for bad English, lack of understanding or if this is already in docs or another post here. I've looked for something similar, but so far couldn't find anything. Any help is greatly appriciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The comma does matter. Append appends an entire header value, what you want is Set to replace the header with a new one. If the destination is serving multiple kinds of content then you'll need to write a custom transform in code to remove, manipulate, and replace the content-type header. See https://microsoft.github.io/reverse-proxy/articles/transforms.html#from-code |
Beta Was this translation helpful? Give feedback.
The comma does matter. Append appends an entire header value, what you want is Set to replace the header with a new one. If the destination is serving multiple kinds of content then you'll need to write a custom transform in code to remove, manipulate, and replace the content-type header. See https://microsoft.github.io/reverse-proxy/articles/transforms.html#from-code