Closed Bug 1488039 Opened 1 year ago Closed 1 year ago

warning message in Console Web for false positive cors test


(Core :: Networking: HTTP, defect, P5, minor)




Tracking Status
firefox64 --- fixed


(Reporter: gwenael.pellen, Assigned: mayhemer)


(Whiteboard: [necko-triaged])


(2 files)

Attached file get-request.har
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180704192850

Steps to reproduce:

prepare site A (https://siteA.tld) with server (nodejs)
prepare site B (https://siteB.tld) with client to connect on site A, simple html page, with polling mode.

Open Firefox on site B. Site B work fine, no problem for use.

BUT polling mode create a GET request on site A, with long timeout (~25s)

If you reload the page (site B)

GET request is canceled, GET request have an empty response.  (get-request.har : extract of har)

CORS test is running on this request and failed.

This issue is tested with user on

contact me on irc.mozilla.og (gwenael) for site exemple.

Actual results:

Warning message is present in Console Web.

in french:

"""Blocage d’une requête multiorigines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur https://siteB/... . Raison : échec de la requête CORS."""

Expected results:

No warning message.

CORS test not be run on cancelled request.
the problem seems to be with HTTP long polling as used by
If there's a long lived HTTP socket waiting to finish that requires CORS, than a refresh of the page will show a CORS error for that request.

It seems that we shouldn't log to the console on cancelled requests, as we can't actually say whether they would or wouldn't get a CORS header in the response.
Component: Untriaged → Networking: HTTP
Product: Firefox → Core
Version: 61 Branch → unspecified
This is very likely not the right component.
The component (Net::HTTP) is correct.  The error is logged from:

the status is NS_BINDING_ABORTED, which is indication of the currently viewed page load cancellation (which we do before reload.)

filtering that error code out is IMO enough to get rid of the warning.
Severity: normal → minor
Ever confirmed: true
Priority: -- → P5
Whiteboard: [necko-triaged]
Assignee: nobody → honzab.moz
Comment on attachment 9006000 [details]
Bug 1488039 - Don't log cancelled CORS requests as errors, r=ckerschb

Christoph Kerschbaumer [:ckerschb] has approved the revision.
Attachment #9006000 - Flags: review+
Keywords: checkin-needed
Pushed by
Don't log cancelled CORS requests as errors, r=ckerschb
Keywords: checkin-needed
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.