在IIS7.5什么模块删除一个400错误请求的主体 [英] In IIS7.5 what module removes the body of a 400 Bad Request

查看:355
本文介绍了在IIS7.5什么模块删除一个400错误请求的主体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了ASP.NET(4.0)code那台Reposonse.Status code至400,如果发布到服务器的数据是有效的。结果
我把在格式响应主体,该请求接受头要求的有用信息。如HTML邮件中说:日期字段是必需的。

I have written ASP.NET (4.0) code that sets the Reposonse.StatusCode to 400 if the data posted to the server is in valid.
I place useful information in the response body in the format that the request accepts header asks for. eg an html message saying "The date field is required...".

在Windows 7上IIS7(7.5.7600)我得到正确的HTML响应返回给浏览器。

In IIS7 (7.5.7600) on Windows 7 I get the correct html response back to the browser.

在Windows 2008上的IIS7(7.5.6000)我不明白的HTML机身背部,但只有文字体错误的请求为内容的。

In IIS7 (7.5.6000) on Windows 2008 I do not get the html body back, but only a text body with "Bad Request" as the content.

有人能指出我如何,我改变了2008年服务器返回主体的构成。结果
或者是有这些版本的IIS之间的区别吗?结果
也许在Machine.config模块?结果
比如我知道(而且不得不解决)的FormsAuthentication模块改变一个401到302,即使你不想要这个。可能有被发送的情况下停止400的内容的模块。

Can someone point me to how I change the configuration of the 2008 server to return the body.
Or is there a difference between these versions of IIS?
Maybe a module in the Machine.config?
For example I know (and have had to work around) that the FormsAuthentication module changes a 401 to a 302 even if you do not want this. May be there is a module that stops the content of a 400 being sent.

TIA。

推荐答案

解决方法:编辑的web.config system.webServer部分,并设置httpErrors existingResponse属性为直通等瞧固定的结果。
即:

Solution: edited the web.config system.webServer section and set httpErrors existingResponse attribute to "PassThrough" et voilá fixed.
ie:

<system.webServer>
    ...
    <httpErrors existingResponse="PassThrough"></httpErrors>
    ...
</system.webServer>

2号井的事情让我思考这个问题:结果
1.经典的customErrors的行为,因为我是用远程服务器结果比较本地主机
2.第一次无法解释怎么我的一些其他身份验证错误通过完整都拿到

Well 2 things got me think about this issue:
1. the classic CustomErrors behaviour because I was comparing localhost with a remote server
2. the first wouldn't explain how some of my other Authentication 'errors' were getting through intact

我周围挖并在本文来到IIS7:的如何使用HTTP错误详情在IIS 7.0

I dug around and came across this article on IIS7: How to Use HTTP Detailed Errors in IIS 7.0

这并不完全属于我发现使用IIS7.5也许编辑的web.config到期时我,但它足以让我进右邻。

It didn't fully pertain to what I found when editing the web.config maybe due me using IIS7.5 but it was enough to get me into the right neighbourhood.

这篇关于在IIS7.5什么模块删除一个400错误请求的主体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆