WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
252564
[GLib] New API to get the request body of WebKitURISchemeRequest
https://bugs.webkit.org/show_bug.cgi?id=252564
Summary
[GLib] New API to get the request body of WebKitURISchemeRequest
Yu-Wei Wu
Reported
2023-02-20 07:17:56 PST
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&. I'm not sure how do I get this. Can I just call blobRegistry() and then pass to it?
Attachments
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2023-02-20 07:44:17 PST
You'd probably need to revert
https://commits.webkit.org/260252@main
... better talk to Carlos Garcia about this.
Yu-Wei Wu
Comment 2
2023-02-20 08:32:15 PST
That commit doesn'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?
Michael Catanzaro
Comment 3
2023-02-20 09:19:15 PST
It's impossible to get the message body outside the network process because it's not serialized anymore. ResourceRequest::updateSoupMessageBody is not a way to get the message body.
Patrick Griffis
Comment 4
2023-02-20 09:42:23 PST
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.
Carlos Garcia Campos
Comment 5
2023-02-21 00:58:00 PST
For custom uri schemes, it's the application the one providing the http body from the UI process, so I don't understand why you need a way to get it again.
Yu-Wei Wu
Comment 6
2023-02-21 01:53:20 PST
(In reply to Carlos Garcia Campos from
comment #5
)
> For custom uri schemes, it's the application the one providing the http body > from the UI process, so I don't understand why you need a way to get it > again.
It could be asking users to fill a form with POST method. Without HTTP body, we can't get the data from the form. It'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 "name=John" if users type the name into the form. I suppose it's still possible to create a soup message body from it? Or should it just transfer the ownership into the callback?
Yu-Wei Wu
Comment 7
2023-02-26 22:54:23 PST
Pull request:
https://github.com/WebKit/WebKit/pull/10714
EWS
Comment 8
2023-02-28 09:43:23 PST
Committed
260949@main
(5fe923aa166a): <
https://commits.webkit.org/260949@main
> Reviewed commits have been landed. Closing PR #10714 and removing active labels.
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