Javascript 如何正确处理Chrome X-XSS-Protection?

Javascript 如何正确处理Chrome X-XSS-Protection?,javascript,ruby-on-rails,google-chrome,firefox,xss,Javascript,Ruby On Rails,Google Chrome,Firefox,Xss,我在Chrome中运行我的应用程序,它有一个错误: Refused to execute script from 'http://example.com/info?no=31&magic=1184' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 从本主题中,我知道应该设置http头X-XSS-Protection:0 我使用RoR将其设

我在Chrome中运行我的应用程序,它有一个错误:

Refused to execute script from 'http://example.com/info?no=31&magic=1184' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 
从本主题中,我知道应该设置http头X-XSS-Protection:0

我使用RoR将其设置为:

def info
  response.headers['X-XSS-Protection'] = '0'
  # Other logic
end
但结果是,http头仍然:

X-XSS-Protection:1; mode=block
X-XSS-Protection:0

当我在Firefox中尝试时,http头是:

X-XSS-Protection    0, 1; mode=block
而且跑得很好


为什么它有
1;模式=块
?如何删除它?

这与XSS保护无关。您需要将上的内容类型HTTP头从text/html更改为text/javascript