<?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>126242</bug_id>
          
          <creation_ts>2013-12-26 01:37:25 -0800</creation_ts>
          <short_desc>[SOUP] Response body are always NULL.</short_desc>
          <delta_ts>2017-03-11 11:05:32 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Angelina">artvideo2003</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>danw</cc>
    
    <cc>gustavo</cc>
    
    <cc>mrobinson</cc>
    
    <cc>svillar</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>962982</commentid>
    <comment_count>0</comment_count>
    <who name="Angelina">artvideo2003</who>
    <bug_when>2013-12-26 01:37:25 -0800</bug_when>
    <thetext>I get current WebKit&apos;s SoupSession and SoupMesssage in Injectedbundle using &quot;request-queued&quot; signal throw g_signal_add_emission_hook. But the response_body of SoupMessageBody are always NULL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>962989</commentid>
    <comment_count>1</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2013-12-26 04:07:00 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; I get current WebKit&apos;s SoupSession and SoupMesssage in Injectedbundle using &quot;request-queued&quot; signal throw g_signal_add_emission_hook. But the response_body of SoupMessageBody are always NULL.

request-queued means that the request was added to the SoupSession queue and is ready to be processed. The request was not even sent to the server at that moment. Check libsoup&apos;s documentation for more information about the signals, like for example here:

https://developer.gnome.org/libsoup/stable/SoupSession.html#SoupSession-request-queued</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>962994</commentid>
    <comment_count>2</comment_count>
    <who name="Angelina">artvideo2003</who>
    <bug_when>2013-12-26 05:27:28 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; (In reply to comment #0)
&gt; &gt; I get current WebKit&apos;s SoupSession and SoupMesssage in Injectedbundle using &quot;request-queued&quot; signal throw g_signal_add_emission_hook. But the response_body of SoupMessageBody are always NULL.
&gt; 
&gt; request-queued means that the request was added to the SoupSession queue and is ready to be processed. The request was not even sent to the server at that moment. Check libsoup&apos;s documentation for more information about the signals, like for example here:
&gt; 
&gt; https://developer.gnome.org/libsoup/stable/SoupSession.html#SoupSession-request-queued

Thanks for the answer. Yes, you are rigth about &quot;request-queued&quot; signal.
But in &quot;request-queued&quot; signal I get the SoupSession and assign SoupMessage callbacks (&quot;wrote-body&quot;, &quot;got-body&quot;, &quot;wrote-chunk&quot; etc).
I trying to get responce SoupMessageBody in &quot;got-body&quot; SoupMessage signal.
Note that &quot;got-chunk&quot; signal doesn&apos;t emit, I think because the response body are empty.
In libsoup&apos;s documentation says: If you are using SoupRequest (as I know WebKit uses SoupRequest), then the message body is not accumulated by default, so response_body&apos;s data will always be NULL.

https://developer.gnome.org/libsoup/stable/SoupMessage.html#SoupMessage-struct

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>963000</commentid>
    <comment_count>3</comment_count>
    <who name="Dan Winship">danw</who>
    <bug_when>2013-12-26 06:45:07 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; In libsoup&apos;s documentation says: If you are using SoupRequest (as I know WebKit uses SoupRequest), then the message body is not accumulated by default, so response_body&apos;s data will always be NULL.
&gt; 
&gt; https://developer.gnome.org/libsoup/stable/SoupMessage.html#SoupMessage-struct

That&apos;s correct-ish... it shouldn&apos;t say &quot;by default&quot;, since there&apos;s actually no way to make it get accumulated (by libsoup) any more. And, as you&apos;ve noticed, got-chunk doesn&apos;t get emitted when using the request API either.

I&apos;m not sure if there&apos;s some webkit-level API you could use to gather the body data from there (eg, hooking into didReceiveData() or something)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>963081</commentid>
    <comment_count>4</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2013-12-27 00:19:26 -0800</bug_when>
    <thetext>In WebKit2 we don&apos;t encourage to use the soup API directly, and that&apos;s why we don&apos;t have public API to get the SoupMessage associated to a request/response. Note that once the network process is implemented, you won&apos;t have access to the soup session in the web process anymore. If you explain your use case we can try to provide public API for it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>963306</commentid>
    <comment_count>5</comment_count>
    <who name="Angelina">artvideo2003</who>
    <bug_when>2013-12-30 03:39:33 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; In WebKit2 we don&apos;t encourage to use the soup API directly, and that&apos;s why we don&apos;t have public API to get the SoupMessage associated to a request/response. Note that once the network process is implemented, you won&apos;t have access to the soup session in the web process anymore. If you explain your use case we can try to provide public API for it.

I want to be able to have access to the source code of the web page (response body of the HTTP message). Cause I want to analyzes the source codes for malicious scripts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>963309</commentid>
    <comment_count>6</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2013-12-30 03:48:59 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; In WebKit2 we don&apos;t encourage to use the soup API directly, and that&apos;s why we don&apos;t have public API to get the SoupMessage associated to a request/response. Note that once the network process is implemented, you won&apos;t have access to the soup session in the web process anymore. If you explain your use case we can try to provide public API for it.
&gt; 
&gt; I want to be able to have access to the source code of the web page (response body of the HTTP message). Cause I want to analyzes the source codes for malicious scripts.

You can do that from the UI process with webkit_web_resource_get_data()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>963313</commentid>
    <comment_count>7</comment_count>
    <who name="Angelina">artvideo2003</who>
    <bug_when>2013-12-30 06:18:08 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; In WebKit2 we don&apos;t encourage to use the soup API directly, and that&apos;s why we don&apos;t have public API to get the SoupMessage associated to a request/response. Note that once the network process is implemented, you won&apos;t have access to the soup session in the web process anymore. If you explain your use case we can try to provide public API for it.
&gt; &gt; 
&gt; &gt; I want to be able to have access to the source code of the web page (response body of the HTTP message). Cause I want to analyzes the source codes for malicious scripts.
&gt; 
&gt; You can do that from the UI process with webkit_web_resource_get_data()

Can I get it in Web Process using C API?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>