简体   繁体   English

X-Content-Type-Options:DWR 中的 nosniff

[英]X-Content-Type-Options:nosniff in DWR

Setting X-Content-Type-Options:nosniff in response header is not allowing the DWR calls to execute.在响应头中设置 X-Content-Type-Options:nosniff 不允许执行 DWR 调用。 Getting text/plain MIME type mismatch.获取文本/纯 MIME 类型不匹配。 Is there a solution for this?有解决方案吗?

I had the same problem activating X-Content-Type-Options: nosniff in the IHS server.我在 IHS 服务器中激活 X-Content-Type-Options: nosniff 时遇到了同样的问题。 I got crazy trying to solve it but the only thing that I found to avoid this error is doing a work-around.我疯狂地试图解决它,但我发现避免此错误的唯一方法是进行变通。

  1. Deactivate X-Content-Type-Options: nosniff in the server.在服务器中停用 X-Content-Type-Options: nosniff。
  2. Enter in the web to the application and copy all the dwr files that generate the pluging.在 web 中输入应用程序并复制所有生成插件的 dwr 文件。
  3. Copy this files to the phisic route of js and change the path to invoke it.把这个文件复制到js的phisic路径,修改路径调用。
  4. Comment the generate of this js files in dwr.xml.在 dwr.xml 中注释这个 js 文件的生成。
  5. Deploy it, activate the rule in the server and test it.部署它,在服务器中激活规则并测试它。

UPDATE: The DWR is an open source lib, you can modify it.更新:DWR 是一个开源库,您可以对其进行修改。 The problem is in the lib because all the js that serve in the interface folder and in the plainjs folder, it set the content type to text/plain.问题出在 lib 中,因为在 interface 文件夹和 plainjs 文件夹中提供的所有 js 都将内容类型设置为 text/plain。 Modify it and it will solve the problem.修改它,它将解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 X-Content-Type-Options = nosniff解决方法 - X-Content-Type-Options = nosniff workaround Liferay 7 - Wildfly 10和“X-Content-Type-Options:nosniff” - Liferay 7 - Wildfly 10 and “X-Content-Type-Options:nosniff” 由于MIME类型不匹配,功能被阻止(X-Content-Type-Options:nosniff) - Function was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff) 由于 MIME 类型不匹配而被阻止的资源(X-Content-Type-Options: nosniff) - Resource blocked due to MIME type mismatch (X-Content-Type-Options: nosniff) 错误:由于 MIME 类型(“text/html”)不匹配而被阻止(X-Content-Type-Options: nosniff) - Error: Blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff) 来自 Firefox 的错误:MIME 类型(“text/plain”)不匹配(X-Content-Type-Options:nosniff) - Error from Firefox: MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff) 由于 MIME 类型 (“text/html”) 不匹配 (X-Content-Type-Options: > nosniff),资源被阻止 - The resource was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: > nosniff) HUGO:由于 MIME 类型(“text/html”)不匹配而被阻止(X-Content-Type-Options: nosniff) - HUGO: was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff) MIME 类型(“text/html”)不匹配(X-Content-Type-Options: nosniff) - MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff) 由于 MIME 类型(“text/html”)不匹配(X-Content-Type-Options: nosniff)而被阻止 - was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM