aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-21 17:37:12 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-21 17:37:12 -0800
commitca434fba6e2373cafc04fe75b349ffd3e1c47d74 (patch)
tree39eea2d3b5c46bd4a9e6526a43f06d2b5f03f69c /src
parent55f8029dc28a8c8cc1e40daae1e888aea48c4a1a (diff)
downloadbun-ca434fba6e2373cafc04fe75b349ffd3e1c47d74.tar.gz
bun-ca434fba6e2373cafc04fe75b349ffd3e1c47d74.tar.zst
bun-ca434fba6e2373cafc04fe75b349ffd3e1c47d74.zip
make it slightly clearer
Diffstat (limited to 'src')
-rw-r--r--src/url.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/url.zig b/src/url.zig
index f51c8cc55..34979df3f 100644
--- a/src/url.zig
+++ b/src/url.zig
@@ -228,7 +228,9 @@ pub const URL = struct {
offset += url.parseProtocol(base[offset..]) orelse 0;
}
- if (!(!is_protocol_relative and base[0] == '/')) {
+ const is_relative_path = !is_protocol_relative and base[0] == '/';
+
+ if (!is_relative_path) {
// if there's no protocol or @, it's ambiguous whether the colon is a port or a username.
if (offset > 0) {