Closed Bug 1253924 Opened 4 years ago Closed 4 years ago

Support HTTP status (statusCode/statusLine) reporting in WebRequest events

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set

Tracking

(firefox47 fixed)

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: mao, Assigned: mao)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [webRequest])

Attachments

(1 file)

Both the statusCode and statusLine should be attached at the details object passed to event listeners whenever the information can be extracted from the underlying HTTP channel.

Currently statusLine is not supported at all, while statusCode doesn't get reported in onBeforeRedirect (where would be useful to determine the kind of the redirection) because of a silly typo :(
Attachment #8727163 - Flags: review?(kmaglione+bmo)
Comment on attachment 8727163 [details]
MozReview Request: Bug 1253924 - Implement statusLine + fix & test statusCode

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/38383/diff/1-2/
Comment on attachment 8727163 [details]
MozReview Request: Bug 1253924 - Implement statusLine + fix & test statusCode

https://reviewboard.mozilla.org/r/38383/#review34955

::: toolkit/components/extensions/test/mochitest/test_ext_webrequest.html:107
(Diff revision 2)
> +        browser.test.assertTrue(code === details.statusCode, `HTTP status code ${code} for ${details.url} (found ${details.statusCode})`);

`browser.test.assertEq` would be better.
Attachment #8727163 - Flags: review?(kmaglione+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/6acd12ff78fd
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.