采用 Windows 身份验证的 IIS 7.5 - POST 时出现间歇性错误 400

采用 Windows 身份验证的 IIS 7.5 - POST 时出现间歇性错误 400

我们的应用在启用了 Windows 身份验证的 IIS 7.5 上运行。通过 POST 上传文件时,一些用户报告 IIS 间歇性出现 400 错误,并显示“无效动词”消息。

我可以自己重现这个问题,通过填写与用户相同的表格并上传相同的文件,连续两次失败,但第三次成功了。

使用 Chrome 的网络选项卡,我能够从失败和成功的尝试中复制请求和响应标头。

我对差异的解释是它在身份验证步骤中失败了,但我可能错了。关于我需要调查什么,有什么建议吗?

成功

POST <redacted> HTTP/1.1
Host: <redacted>
Connection: keep-alive
Content-Length: 26636
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: <redacted>
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryQ6KIItP6Z7A76guk
Referer: <redacted>
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
Cookie: <redacted>
X-CookiesOK: I explicitly accept all cookies

HTTP/1.1 302 Found
Content-Type: text/html; charset=UTF-8
Location: <redacted>
Server: Microsoft-IIS/7.5
X-Powered-By: PHP/5.6.6
X-Powered-By: ASP.NET
Date: Wed, 17 Jun 2015 10:37:42 GMT
Content-Length: 164

失败

POST <redacted> HTTP/1.1
Host: <redacted>
Connection: keep-alive
Content-Length: 46013
Cache-Control: max-age=0
Authorization: NTLM <redacted>==
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: <redacted>
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryY5kiMQ9SHsqAoBjs
Referer: <redacted>
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
Cookie: <redacted>
X-CookiesOK: I explicitly accept all cookies

HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 17 Jun 2015 10:43:50 GMT
Connection: close
Content-Length: 326

http.sys痕迹:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
        <Provider Name="Microsoft-Windows-HttpService" Guid="{dd5ef90a-6398-47a4-ad34-4dcecdef795f}" />
        <EventID>52</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>1</Task>
        <Opcode>62</Opcode>
        <Keywords>0x8000000000000002</Keywords>
        <TimeCreated SystemTime="2015-06-17T13:14:10.558152100Z" />
        <Correlation ActivityID="{80000507-0000-7000-b63f-84710c7967bb}" />
        <Execution ProcessID="4" ThreadID="1376" ProcessorID="0" KernelTime="32565" UserTime="0" />
        <Channel>Microsoft-Windows-HttpService/Trace</Channel>
        <Computer />
    </System>
    <EventData>
        <Data Name="Status">0xC0000010</Data>
        <Data Name="RequestId">0x7000000080000507</Data>
        <Data Name="Reason">VerbLookupFailed</Data>
        <Data Name="ErrorCode">       2</Data>
        <Data Name="HintLength">       8</Data>
        <Data Name="HintData">0x535541696A6A5648</Data>
    </EventData>
    <RenderingInfo Culture="en-US">
        <Level>Error </Level>
        <Opcode>ParseRequestFailed </Opcode>
        <Keywords>
            <Keyword>Flagged on all HTTP events dealing with request processing </Keyword>
        </Keywords>
        <Task>HTTP Request Trace Task </Task>
        <Message>Parsing of request (request ID 0x7000000080000507) failed due to reason: VerbLookupFailed. Request may not be compliant with HTTP/1.1. </Message>
        <Channel>HTTP Service Channel </Channel>
        <Provider>Microsoft-Windows-HttpService </Provider>
    </RenderingInfo>
</Event>

相关内容