<?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>252564</bug_id>
          
          <creation_ts>2023-02-20 07:17:56 -0800</creation_ts>
          <short_desc>[GLib] New API to get the request body of WebKitURISchemeRequest</short_desc>
          <delta_ts>2023-02-28 09:43:27 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yu-Wei Wu">wusyong9104</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>pgriffis</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1935073</commentid>
    <comment_count>0</comment_count>
    <who name="Yu-Wei Wu">wusyong9104</who>
    <bug_when>2023-02-20 07:17:56 -0800</bug_when>
    <thetext>At the moment WebKitURISchemeRequest can access HTTP headers and methods but not the body. I would like to help add the body-getter for this type.

It looks like we can call ResourceRequest::updateSoupMessageBody to get the body. However, its parameters require a type BlobRegistryImpl&amp;. I&apos;m not sure how do I get this. Can I just call blobRegistry() and then pass to it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1935077</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-02-20 07:44:17 -0800</bug_when>
    <thetext>You&apos;d probably need to revert https://commits.webkit.org/260252@main... better talk to Carlos Garcia about this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1935093</commentid>
    <comment_count>2</comment_count>
    <who name="Yu-Wei Wu">wusyong9104</who>
    <bug_when>2023-02-20 08:32:15 -0800</bug_when>
    <thetext>That commit doesn&apos;t seem to affect ResourceRequest::updateSoupMessageBody. This method also calls methods from ResourceRequestBase itself. Or is there somewhere else that will make its body missing when calling updateSoupMessageBody?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1935114</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-02-20 09:19:15 -0800</bug_when>
    <thetext>It&apos;s impossible to get the message body outside the network process because it&apos;s not serialized anymore.

ResourceRequest::updateSoupMessageBody is not a way to get the message body.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1935121</commentid>
    <comment_count>4</comment_count>
    <who name="Patrick Griffis">pgriffis</who>
    <bug_when>2023-02-20 09:42:23 -0800</bug_when>
    <thetext>I left some comments on the upstream Tauri bug for this: https://github.com/tauri-apps/wry/issues/666

My general feeling was also that this is tricky or impossible to do efficiently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1935441</commentid>
    <comment_count>5</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2023-02-21 00:58:00 -0800</bug_when>
    <thetext>For custom uri schemes, it&apos;s the application the one providing the http body from the UI process, so I don&apos;t understand why you need a way to get it again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1935450</commentid>
    <comment_count>6</comment_count>
    <who name="Yu-Wei Wu">wusyong9104</who>
    <bug_when>2023-02-21 01:53:20 -0800</bug_when>
    <thetext>
(In reply to Carlos Garcia Campos from comment #5)
&gt; For custom uri schemes, it&apos;s the application the one providing the http body
&gt; from the UI process, so I don&apos;t understand why you need a way to get it
&gt; again.

It could be asking users to fill a form with POST method. Without HTTP body, we can&apos;t get the data from the form. It&apos;s common to send requests with the body containing some data IMHO.

Btw I tried to test a bit, and it seems the httpBody of the ResourceRequest is still valid when calling the URI scheme callback. Take above form as an example, I can get &quot;name=John&quot; if users type the name into the form. I suppose it&apos;s still possible to create a soup message body from it? Or should it just transfer the ownership into the callback?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1936935</commentid>
    <comment_count>7</comment_count>
    <who name="Yu-Wei Wu">wusyong9104</who>
    <bug_when>2023-02-26 22:54:23 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/10714</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1937427</commentid>
    <comment_count>8</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-02-28 09:43:23 -0800</bug_when>
    <thetext>Committed 260949@main (5fe923aa166a): &lt;https://commits.webkit.org/260949@main&gt;

Reviewed commits have been landed. Closing PR #10714 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>