Remove charset from Rails content type

后端 未结 4 1047
轮回少年
轮回少年 2021-01-18 13:27

I have a old-stupid service making request to my app that fails when the Content-Type include the charset line

Content-Type    text/html; charset=utf-8
         


        
4条回答
  •  情深已故
    2021-01-18 13:48

    The only way I was able to get it to work is by setting the default charset

    ActionController::Base.default_charset = nil
    

    Also, setting the Content-Transfer-Encoding header to binary will turn off the charset.

提交回复
热议问题