Closed
Bug 1122258
Opened 10 years ago
Closed 10 years ago
Fetch API: Set flag on channel based on credentials mode.
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: nsm, Assigned: nsm)
References
Details
Attachments
(1 file)
(deleted),
patch
|
bkelly
:
review+
baku
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•10 years ago
|
||
Ben, the actual change is only 1 line, in NS_NewChannel, we use the value of useCredentials to decide whether to pass the LOAD_ANONYMOUS flag or not.
This implements Section 4.3, step 4 and 13, where LOAD_ANONYMOUS is the opposite of credentials flag being set.
Attachment #8549915 -
Flags: review?(bkelly)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → nsm.nikhil
Status: NEW → ASSIGNED
Comment 2•10 years ago
|
||
Comment on attachment 8549915 [details] [diff] [review]
Fetch API: Set anonymous flag on channel if no credentials are to be passed
Review of attachment 8549915 [details] [diff] [review]:
-----------------------------------------------------------------
One minor comment, but otherwise looks good. Thanks for writing tests for all these things!
::: dom/fetch/FetchDriver.cpp
@@ +347,5 @@
> + mRequest->GetContext(),
> + mLoadGroup,
> + nullptr, /* aCallbacks */
> + nsIRequest::LOAD_NORMAL |
> + (useCredentials ? 0 : nsIRequest::LOAD_ANONYMOUS),
I think its a bit obfuscating to use a terniary bitwise-OR'd in the middle of the method call. Can you do something like this instead:
nsSecurityFlags credentialsFlag = useCredentials ? 0 : nsIRequest::LOAD_ANONYMOUS;
And then in the NS_NewChannel() call:
nsIRequest::LOAD_NORMAL | credentialsFlag
Attachment #8549915 -
Flags: review?(bkelly)
Attachment #8549915 -
Flags: review?(amarchesini)
Attachment #8549915 -
Flags: review+
Comment 3•10 years ago
|
||
Comment on attachment 8549915 [details] [diff] [review]
Fetch API: Set anonymous flag on channel if no credentials are to be passed
Review of attachment 8549915 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/fetch/FetchDriver.cpp
@@ +347,5 @@
> + mRequest->GetContext(),
> + mLoadGroup,
> + nullptr, /* aCallbacks */
> + nsIRequest::LOAD_NORMAL |
> + (useCredentials ? 0 : nsIRequest::LOAD_ANONYMOUS),
... or at least indent it properly:
nsIRequest::LOAD_NORMAL |
(useCredentials ? 0 : nsIRequest::LOAD_ANONYMOUS)
But I prefer what bkelly proposes.
Attachment #8549915 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 4•10 years ago
|
||
Comment 5•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•