Windows 7上的IIS:请求XML文件时出现400错误请求 [英] IIS on Windows 7: 400 bad request when requesting XML files
问题描述
我在Windows 7上有一个在IIS下运行的网站。
每次网页请求XML文件时,我都会收到400 Bad Request(通过firebug诊断)。如果我通过在浏览器中输入XML文件来直接请求XML文件就可以了。
I have a website running under IIS on Windows 7. Everytime the webpage requests an XML file I receive a 400 Bad Request (diagnosed through firebug). If I request the XML file directly by typing it into my browser it works.
这不仅适用于 .xml
文件扩展名,但 .xsl
也是;两者都包含XML数据。
This not only happens for .xml
file extensions but .xsl
too; both of which contain XML data.
推荐答案
我发现了这个问题。
在请求XML文件时,我添加了HTTP规范中的 If-Modified-Since
标头,但Windows 7上的IIS似乎返回 400错误请求
添加时。只需从请求中删除此标头即可解决问题。
When requesting the XML files I was adding the If-Modified-Since
header which is in the HTTP spec but IIS on Windows 7 seems to return 400 Bad Request
when this is added. Simply removing this header from the request fixes the issue.
这篇关于Windows 7上的IIS:请求XML文件时出现400错误请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!