<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>262635</bug_id>
          
          <creation_ts>2023-10-04 11:21:49 -0700</creation_ts>
          <short_desc>FetchResponse.formData() should parse headers names as case insensitive</short_desc>
          <delta_ts>2023-10-10 09:13:17 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>Safari 17</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/42455</see_also>
          <bug_file_loc>https://jsfiddle.net/x0o1mqj8/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jimmy Wärting">jimmy</reporter>
          <assigned_to name="sideshowbarker">mike</assigned_to>
          <cc>achristensen</cc>
    
    <cc>annevk</cc>
    
    <cc>cdumez</cc>
    
    <cc>mike</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1982504</commentid>
    <comment_count>0</comment_count>
    <who name="Jimmy Wärting">jimmy</who>
    <bug_when>2023-10-04 11:21:49 -0700</bug_when>
    <thetext>## reproducible code:

async function init() {
  var fd = new FormData()
  fd.set(&apos;x&apos;, &apos;y&apos;)
  var blob = await new Response(fd).blob()
  var body = await blob.text()
  blob = new Blob([body.toLowerCase()], { 
    // convert boundary to lowercase also.
    type: blob.type.toLowerCase() 
  })
  fd = await new Response(blob).formData()
  console.log([...fd])
}

init()


## Test page:
https://jsfiddle.net/x0o1mqj8/


Works in Firefox, and all chromium browsers
fails in safari</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1982827</commentid>
    <comment_count>1</comment_count>
    <who name="sideshowbarker">mike</who>
    <bug_when>2023-10-05 05:36:06 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/18689</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1982828</commentid>
    <comment_count>2</comment_count>
    <who name="sideshowbarker">mike</who>
    <bug_when>2023-10-05 05:42:21 -0700</bug_when>
    <thetext>If we do actually want to have interop on this, I can add WPT tests to the PR — and also I guess, update the algorithm at https://fetch.spec.whatwg.org/#dom-body-formdata to explicitly that the Content-Disposition and Content-Type headers names must be parsed case-insensitively. (Though, as noted in the comment which follows that algorithm in the spec: The algorithm is just “a rough approximation of what is needed for multipart/form-data” — that is, it’s already recognized to be underspecified…)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983996</commentid>
    <comment_count>3</comment_count>
    <who name="sideshowbarker">mike</who>
    <bug_when>2023-10-10 08:43:20 -0700</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/42455</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1984009</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-10 09:12:31 -0700</bug_when>
    <thetext>Committed 269144@main (d0c370d532ad): &lt;https://commits.webkit.org/269144@main&gt;

Reviewed commits have been landed. Closing PR #18689 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1984010</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-10 09:13:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/116742000&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>