mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
browser: fix buffer url usage w/ the arena
This commit is contained in:
@@ -368,9 +368,6 @@ pub const Page = struct {
|
|||||||
|
|
||||||
// update uri after eventual redirection
|
// update uri after eventual redirection
|
||||||
var buf: std.ArrayListUnmanaged(u8) = .{};
|
var buf: std.ArrayListUnmanaged(u8) = .{};
|
||||||
defer buf.deinit(arena);
|
|
||||||
|
|
||||||
buf.clearRetainingCapacity();
|
|
||||||
try request.uri.writeToStream(.{
|
try request.uri.writeToStream(.{
|
||||||
.scheme = true,
|
.scheme = true,
|
||||||
.authentication = true,
|
.authentication = true,
|
||||||
@@ -379,7 +376,7 @@ pub const Page = struct {
|
|||||||
.query = true,
|
.query = true,
|
||||||
.fragment = true,
|
.fragment = true,
|
||||||
}, buf.writer(arena));
|
}, buf.writer(arena));
|
||||||
self.rawuri = try buf.toOwnedSlice(arena);
|
self.rawuri = buf.items;
|
||||||
|
|
||||||
self.uri = try std.Uri.parse(self.rawuri.?);
|
self.uri = try std.Uri.parse(self.rawuri.?);
|
||||||
|
|
||||||
@@ -389,12 +386,12 @@ pub const Page = struct {
|
|||||||
try self.session.window.replaceLocation(&self.location);
|
try self.session.window.replaceLocation(&self.location);
|
||||||
|
|
||||||
// prepare origin value.
|
// prepare origin value.
|
||||||
buf.clearRetainingCapacity();
|
buf = .{};
|
||||||
try request.uri.writeToStream(.{
|
try request.uri.writeToStream(.{
|
||||||
.scheme = true,
|
.scheme = true,
|
||||||
.authority = true,
|
.authority = true,
|
||||||
}, buf.writer(arena));
|
}, buf.writer(arena));
|
||||||
self.origin = try buf.toOwnedSlice(arena);
|
self.origin = buf.items;
|
||||||
|
|
||||||
log.info("GET {any} {d}", .{ self.uri, header.status });
|
log.info("GET {any} {d}", .{ self.uri, header.status });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user