>  기사  >  백엔드 개발  >  javascript - 浏览器请求服务器遇到412报错,咋回事?

javascript - 浏览器请求服务器遇到412报错,咋回事?

WBOY
WBOY원래의
2016-06-06 20:10:532598검색

我做一个生成html页面的功能,在浏览器准备好需要生成页面的html代码,以post方式,html代码作为参数传给生成页面功能的php文件,php拿这些html代码进行写文件操作并且返回该文件路径,浏览器收到路径跳转到生成后的页面。

我在本地服务器很正常没有报错,在外网服务器却报了412错误,报错内容如下:

<code>412 Error

Your request got filtered out due to possible security issues.

One or more things in your request were suspicious (defective request header, invalid cookies, bad parameters)

If you think you did nothing wrong:

try again with a different browser
avoid any evil characters inside the request url
If you are the owner of the website, you can consider revising the rules of the mod_security module or turning it off from your Web Hosting Control Panel.
</code>

回复内容:

我做一个生成html页面的功能,在浏览器准备好需要生成页面的html代码,以post方式,html代码作为参数传给生成页面功能的php文件,php拿这些html代码进行写文件操作并且返回该文件路径,浏览器收到路径跳转到生成后的页面。

我在本地服务器很正常没有报错,在外网服务器却报了412错误,报错内容如下:

<code>412 Error

Your request got filtered out due to possible security issues.

One or more things in your request were suspicious (defective request header, invalid cookies, bad parameters)

If you think you did nothing wrong:

try again with a different browser
avoid any evil characters inside the request url
If you are the owner of the website, you can consider revising the rules of the mod_security module or turning it off from your Web Hosting Control Panel.
</code>

mod_security 服务器这个模块,阻止了这次请求,因为可能会有安全漏洞,例如xss。

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.