[英]IIS7.5 on Windows Server 2008 R2 (VPS) - Error 400 on POST Request
I have a new VPS server running 2008 R2 and IIS 7.5.我有一个运行 2008 R2 和 IIS 7.5 的新 VPS 服务器。
Some client software (not browser) communicates with a server application (ASP.NET) via HTTP GET and POST requests.一些客户端软件(不是浏览器)通过 HTTP GET 和 POST 请求与服务器应用程序 (ASP.NET) 通信。
On IIS7.5 the HTTP POST requests are rejected with the error: "HTTP Error 400 - Request is badly formed"在 IIS7.5 上,HTTP POST 请求被拒绝并出现错误:“HTTP 错误 400 - 请求格式错误”
The same application works with no issues on IIS7 and has worked for years on IIS6.相同的应用程序在 IIS7 上运行没有问题,并且在 IIS6 上运行了多年。
I can only assume IIS7.5 does some additional validation checks?我只能假设 IIS7.5 做了一些额外的验证检查? Is there any way to turn them off?有什么办法可以关闭它们吗? I tried all the settings I found on MSDN but nothing seems to work so far and I cannot even get IIS to dump a log for the rejected requests!我尝试了在 MSDN 上找到的所有设置,但到目前为止似乎没有任何效果,我什至无法让 IIS 为被拒绝的请求转储日志!
Changing the client code is not an option.更改客户端代码不是一种选择。
Below is the POST Request that fails.下面是失败的 POST 请求。
Thank you, Nikos.谢谢你,尼科斯。
POST /NK002/Inbound.ashx?rid=0 HTTP/1.1
User-Agent: nkHTTP_1
Accept: */*
Accept-Encoding: identity; application/octet-stream; application/x-www-form-urlencoded
Host: www.nks001.com
Connection: keep-alive
Content-Length: 307
<nkXML>
<header count="2">
<service>Connection</service>
<function>Initialize</function>
</header>
<body count="4">
<platform>Windows</platform>
<data>BbbFBwAAAABFPaRkAAAAAHN5aE8AAAAA</data>
<attName_0>PoolRebel.Version</attName_0>
<attValue_0>2</attValue_0>
</body>
</nkXML>
The problem is your Accept-Encoding:
header.问题是您的Accept-Encoding:
header。 The last two Content-Codings are not valid:最后两个内容编码无效:
application/octet-stream application/x-www-form-urlencoded
According to IANA's permissiable Content-Coding values you can only use:根据 IANA 允许的内容编码值,您只能使用:
compress deflate exi gzip indentity pack200-gzip
Hypertext Transfer Protocol (HTTP) Parameters - IANA超文本传输协议 (HTTP) 参数 - IANA
IIS7.5 adhere's more rigorously to the standards than previous versions. IIS7.5 比以前的版本更严格地遵守标准。
Update:更新:
Further digging about produced this forum discussion:进一步挖掘产生了这个论坛讨论:
Thread: IIS 7.5 Accept-Encoding fails with multiple values线程:IIS 7.5 Accept-Encoding 失败并出现多个值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.