Bug 206349

Summary: Web Inspector: should make it more visible that an OPTIONS request is made (and failed) for XMLHttpRequest
Product: WebKit Reporter: Henk Poley <HenkPoley>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: inspector-bugzilla-changes
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   

Description Henk Poley 2020-01-16 05:09:44 PST
When an OPTIONS request fails to properly respond, it would be nice if something like "[Error] Invalid response to OPTIONS request" should be logged in the JavaScript console and visualized the Web Inspector.

Currently, when you do an XMLHttpRequest, and the server fails to respond to a request that uses the OPTIONS method, this fact is kept secret to the developer looking at the Web Inspector.

You will only see the generic `[Error] XMLHttpRequest cannot load ..URL.. due to access control checks.` in the JavaScript console. Other problems around Cross-Origin Resource Sharing (CORS) with XMLHttpRequest will write a descriptive [Error] to the JavaScript console. The use of the OPTIONS method is only disclosed by doing a MITM-attack on the connection to the offending API. This is not very developer friendly. Readily available 'answers' through search engines will not mention what you need to fix, since other CORS problems also return that generic [Error].

(Tested in WebKit/Windows buildbot build 254668)