aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index 133418681..7fe713d3e 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -4319,6 +4319,11 @@ static CURLcode parse_remote_port(struct SessionHandle *data,
*portptr = '\0'; /* cut off the name there */
conn->remote_port = curlx_ultous(port);
}
+ else if(!port)
+ /* Browser behavior adaptation. If there's a colon with no digits after,
+ just cut off the name there which makes us ignore the colon and just
+ use the default port. Firefox and Chrome both do that. */
+ *portptr = '\0';
}
return CURLE_OK;
}