-
Notifications
You must be signed in to change notification settings - Fork 250
request interception #930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request interception #930
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -467,13 +467,17 @@ pub const Page = struct { | |
const owned_url = try self.arena.dupeZ(u8, request_url); | ||
self.url = try URL.parse(owned_url, null); | ||
|
||
var headers = try HttpClient.Headers.init(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A lot of internal failure cases will result in this leaking. But I think we can leave it as-is for now. The difficulty in resource management here is that we need to be careful about allocations up to the point where I want to address it, but, at this point, after we merge everything. |
||
if (opts.header) |hdr| try headers.add(hdr); | ||
try self.requestCookie(.{ .is_navigation = true }).headersForRequest(self.arena, owned_url, &headers); | ||
|
||
self.http_client.request(.{ | ||
.ctx = self, | ||
.url = owned_url, | ||
.method = opts.method, | ||
.headers = headers, | ||
.body = opts.body, | ||
.header = opts.header, | ||
.cookie = self.requestCookie(.{ .is_navigation = true }), | ||
.cookie_jar = self.cookie_jar, | ||
.header_done_callback = pageHeaderDoneCallback, | ||
.data_callback = pageDataCallback, | ||
.done_callback = pageDoneCallback, | ||
|
Uh oh!
There was an error while loading. Please reload this page.