WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
126242
[SOUP] Response body are always NULL.
https://bugs.webkit.org/show_bug.cgi?id=126242
Summary
[SOUP] Response body are always NULL.
Angelina
Reported
2013-12-26 01:37:25 PST
I get current WebKit's SoupSession and SoupMesssage in Injectedbundle using "request-queued" signal throw g_signal_add_emission_hook. But the response_body of SoupMessageBody are always NULL.
Attachments
Add attachment
proposed patch, testcase, etc.
Sergio Villar Senin
Comment 1
2013-12-26 04:07:00 PST
(In reply to
comment #0
)
> I get current WebKit's SoupSession and SoupMesssage in Injectedbundle using "request-queued" 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's documentation for more information about the signals, like for example here:
https://developer.gnome.org/libsoup/stable/SoupSession.html#SoupSession-request-queued
Angelina
Comment 2
2013-12-26 05:27:28 PST
(In reply to
comment #1
)
> (In reply to
comment #0
) > > I get current WebKit's SoupSession and SoupMesssage in Injectedbundle using "request-queued" 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's documentation for more information about the signals, like for example here: > >
https://developer.gnome.org/libsoup/stable/SoupSession.html#SoupSession-request-queued
Thanks for the answer. Yes, you are rigth about "request-queued" signal. But in "request-queued" signal I get the SoupSession and assign SoupMessage callbacks ("wrote-body", "got-body", "wrote-chunk" etc). I trying to get responce SoupMessageBody in "got-body" SoupMessage signal. Note that "got-chunk" signal doesn't emit, I think because the response body are empty. In libsoup'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's data will always be NULL.
https://developer.gnome.org/libsoup/stable/SoupMessage.html#SoupMessage-struct
Thanks.
Dan Winship
Comment 3
2013-12-26 06:45:07 PST
(In reply to
comment #2
)
> In libsoup'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's data will always be NULL. > >
https://developer.gnome.org/libsoup/stable/SoupMessage.html#SoupMessage-struct
That's correct-ish... it shouldn't say "by default", since there's actually no way to make it get accumulated (by libsoup) any more. And, as you've noticed, got-chunk doesn't get emitted when using the request API either. I'm not sure if there's some webkit-level API you could use to gather the body data from there (eg, hooking into didReceiveData() or something)
Carlos Garcia Campos
Comment 4
2013-12-27 00:19:26 PST
In WebKit2 we don't encourage to use the soup API directly, and that's why we don't have public API to get the SoupMessage associated to a request/response. Note that once the network process is implemented, you won'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.
Angelina
Comment 5
2013-12-30 03:39:33 PST
(In reply to
comment #4
)
> In WebKit2 we don't encourage to use the soup API directly, and that's why we don't have public API to get the SoupMessage associated to a request/response. Note that once the network process is implemented, you won'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.
Carlos Garcia Campos
Comment 6
2013-12-30 03:48:59 PST
(In reply to
comment #5
)
> (In reply to
comment #4
) > > In WebKit2 we don't encourage to use the soup API directly, and that's why we don't have public API to get the SoupMessage associated to a request/response. Note that once the network process is implemented, you won'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.
You can do that from the UI process with webkit_web_resource_get_data()
Angelina
Comment 7
2013-12-30 06:18:08 PST
(In reply to
comment #6
)
> (In reply to
comment #5
) > > (In reply to
comment #4
) > > > In WebKit2 we don't encourage to use the soup API directly, and that's why we don't have public API to get the SoupMessage associated to a request/response. Note that once the network process is implemented, you won'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. > > You can do that from the UI process with webkit_web_resource_get_data()
Can I get it in Web Process using C API?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug