Closed
Bug 1122194
Opened 10 years ago
Closed 10 years ago
Follow method validation rules in Request constructor
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: nsm, Assigned: nsm)
References
Details
Attachments
(1 file)
4.10 KB,
patch
|
bkelly
:
review+
baku
:
review+
|
Details | Diff | Splinter Review |
Step 14 of the request constructor is not implemented properly currently.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8549831 -
Flags: review?(bkelly)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → nsm.nikhil
Status: NEW → ASSIGNED
Comment 2•10 years ago
|
||
Comment on attachment 8549831 [details] [diff] [review]
Follow method validation rules when constructing Request
Review of attachment 8549831 [details] [diff] [review]:
-----------------------------------------------------------------
The normalization of just some headers confused me, but that is indeed what the spec says. LGTM. Thanks!
Over to Andrea as DOM peer.
Attachment #8549831 -
Flags: review?(bkelly)
Attachment #8549831 -
Flags: review?(amarchesini)
Attachment #8549831 -
Flags: review+
Comment 3•10 years ago
|
||
Comment on attachment 8549831 [details] [diff] [review]
Follow method validation rules when constructing Request
Review of attachment 8549831 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/fetch/Request.cpp
@@ +155,2 @@
> if (aInit.mMethod.WasPassed()) {
> nsCString method = aInit.mMethod.Value();
nsAutoCString
@@ +157,4 @@
>
> + // Step 14.1. Disallow forbidden methods, and anything that is not a HTTP
> + // token, since HTTP states that Method may be any of the defined values or
> + // a token (extension method).
I still prefer the lowerCase approach. These are several string operations and for each one you ask to convert the method to lower case.
Can you do something similar to:
nsAutoString lowerCaseMethod;
nsContentUtils::ASCIIToLower(aInit.mMethod.Value(), lowerCaseMethod);
Attachment #8549831 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 4•10 years ago
|
||
I Used an uppercase approach instead since normalization is uppercasing.
Assignee | ||
Comment 5•10 years ago
|
||
Comment 6•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment 8•10 years ago
|
||
Comment on attachment 8549831 [details] [diff] [review]
Follow method validation rules when constructing Request
Review of attachment 8549831 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/fetch/Request.cpp
@@ +160,5 @@
> + // a token (extension method).
> + if (method.LowerCaseEqualsLiteral("connect") ||
> + method.LowerCaseEqualsLiteral("trace") ||
> + method.LowerCaseEqualsLiteral("track") ||
> + !NS_IsValidHTTPToken(method)) {
Missing #include "nsNetUtil.h"
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
•