Remove charset from Rails content type

后端 未结 4 1051
轮回少年
轮回少年 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

    Putting this in the controller did it for me:

    ActionDispatch::Response::default_charset = nil
    

    I put in in my base controller to remove it from all responses.

提交回复
热议问题