标签: ruby-on-rails http-headers httpresponse http-response-codes
我想从(ruby on rails)响应中删除一些标题
标题回复:
我要删除或更改的标头是:
答案 0 :(得分:6)
您可以尝试直接在控制器中操作响应:
response.headers['Connection'] = 'Closed' remove_keys = %w(X-Runtime Cache-Control Server Etag Set-Cookie) response.headers.delete_if{|key| remove_keys.include? key}