mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-14 23:38:57 +00:00
Merge pull request #1198 from lightpanda-io/nikneym/url-trim
Trim CR and LF characters from both ends
This commit is contained in:
@@ -81,10 +81,12 @@ pub const URL = struct {
|
||||
/// For URLs without a path, it will add src as the path.
|
||||
pub fn stitch(
|
||||
allocator: Allocator,
|
||||
path: []const u8,
|
||||
raw_path: []const u8,
|
||||
base: []const u8,
|
||||
comptime opts: StitchOpts,
|
||||
) !StitchReturn(opts) {
|
||||
const path = std.mem.trim(u8, raw_path, &.{ '\n', '\r' });
|
||||
|
||||
if (base.len == 0 or isCompleteHTTPUrl(path)) {
|
||||
return simpleStitch(allocator, path, opts);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user