Bug 252564
| Summary: | [GLib] New API to get the request body of WebKitURISchemeRequest | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Yu-Wei Wu <wusyong9104> |
| Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | aperez, bugs-noreply, cgarcia, mcatanzaro, pgriffis |
| Priority: | P2 | ||
| Version: | Other | ||
| Hardware: | PC | ||
| OS: | Linux | ||
Yu-Wei Wu
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
You'd probably need to revert https://commits.webkit.org/260252@main... better talk to Carlos Garcia about this.
Yu-Wei Wu
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
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
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
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
(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
Pull request: https://github.com/WebKit/WebKit/pull/10714
EWS
Committed 260949@main (5fe923aa166a): <https://commits.webkit.org/260949@main>
Reviewed commits have been landed. Closing PR #10714 and removing active labels.