我們的應用程式在啟用了 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>