Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6305f2666d86cb20dac1d912c5a19d8a36a98d16
      
https://github.com/WebKit/WebKit/commit/6305f2666d86cb20dac1d912c5a19d8a36a98d16
  Author: Charlie Wolfe <[email protected]>
  Date:   2026-06-11 (Thu, 11 Jun 2026)

  Changed paths:
    A 
LayoutTests/http/tests/misc/form-data-encoding-uses-effective-method-expected.txt
    A LayoutTests/http/tests/misc/form-data-encoding-uses-effective-method.html
    M Source/WebCore/loader/FormSubmission.cpp

  Log Message:
  -----------
  FormSubmission::create chooses the form-data encoding from the original 
method instead of the effective one
https://bugs.webkit.org/show_bug.cgi?id=316833
rdar://179276869

Reviewed by Alex Christensen.

create() copies the incoming Attributes into copiedAttributes and then applies 
the submitter's
overrides to that copy. Every subsequent decision reads the effective values 
from copiedAttributes,
but the non-multipart FormData encoding choice read the original 
attributes.method() instead.

This only diverges when a submitter's formmethod flips the form's method 
between GET and POST. For
example, a method="get" enctype="text/plain" form submitted by a 
formmethod="post" button has an
effective method of POST, so its body must be text/plain encoded. Because the 
encoding was picked
from the original GET method, the body was instead form-urlencoded even though 
the Content-Type was
text/plain.

Use copiedAttributes.method() to match every other branch in the function.

This bug exists in Chrome too, but not in Firefox.

Test: http/tests/misc/form-data-encoding-uses-effective-method.html

* 
LayoutTests/http/tests/misc/form-data-encoding-uses-effective-method-expected.txt:
 Added.
* LayoutTests/http/tests/misc/form-data-encoding-uses-effective-method.html: 
Added.
* Source/WebCore/loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):

Canonical link: https://commits.webkit.org/315045@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to