mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-01 00:44:54 -04:00
Cleanup HttpClient.Transfer
This is just moving fields around. The end result is that there's a `transfer.req` and a `transfer.res`. On the Request side, we use to have a nested `params: RequestParam` resulting in a lot of `transfer.req.params.url`. This is now `transfer.req.url`. On the Response side, we had the exact opposite: response fields splattered directly in the transfer, `transfer.response_header`. This is now `transfer.res.header`. There is now an HttpClient.Response, which is the actual final response (which could be for a transfer or something else, e.g the cache). And an HttpClient.Transfer.Response which captures the inflight response data (and is one of the polymorphic variants of the HttpClient.Response). Probably still not ideal, but I'm not sure how to make it cleaner, and even if this is just an intermediary step, I consider it an small win.
This commit is contained in:
15 files changed
+279
-303
No files matched your search
@@ -44,8 +44,8 @@ fn request(ptr: *anyopaque, transfer: *Transfer) anyerror!void {
|
||||
|
||||
const wba = transfer.client.network.web_bot_auth orelse @panic("WebBotAuthLayer shouldn't be active without WebBotAuth");
|
||||
|
||||
const authority = URL.getHost(transfer.url);
|
||||
try wba.signRequest(transfer.arena, &transfer.req.params.headers, authority);
|
||||
const authority = URL.getHost(transfer.req.url);
|
||||
try wba.signRequest(transfer.arena, &transfer.req.headers, authority);
|
||||
|
||||
return self.next.request(transfer);
|
||||
}
|
||||
Reference in new issue
Block a user