Closed Bug 1122677 Opened 10 years ago Closed 10 years ago

Disallow request body when method is HEAD/GET

Categories

(Core :: DOM: Core & HTML, defect)

33 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: nsm, Assigned: nsm)

References

Details

Attachments

(1 file)

This was previously unspecified, but clarified by :annevk. Spec bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=27846
Assignee: nobody → nsm.nikhil
Comment on attachment 8551993 [details] [diff] [review]
Disallow request body when method is HEAD/GET

Review of attachment 8551993 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM.  Flag baku for peer sign off.

::: dom/fetch/Request.cpp
@@ +220,5 @@
>    if (aInit.mBody.WasPassed()) {
> +    // HEAD and GET are not allowed to have a body.
> +    nsAutoCString method;
> +    request->GetMethod(method);
> +    if (method.EqualsLiteral("HEAD") || method.EqualsLiteral("GET")) {

nit: Add a comment that HEAD and GET are guaranteed to be uppercase due to step 14.2 above.
Attachment #8551993 - Flags: review?(bkelly)
Attachment #8551993 - Flags: review?(amarchesini)
Attachment #8551993 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/a76ced5f328c
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Attachment #8551993 - Flags: review?(amarchesini) → review+
Gah, sorry I broke protocol there by landing before Andrea's review. Hadn't noticed that flag.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: