Fossil SCM

After the port number in a URL, now accept '?' and '#' as well as '/' (RFC 3986 section 3.2). From libfossil.

danshearer 2026-10-12 11:19 UTC trunk
Commit 36beb09dd571f9da9035872ad28f04af8715fbdcc875d04e67db2f609841a0f3
1 file changed +3 -1
+3 -1
--- src/url.c
+++ src/url.c
@@ -237,11 +237,13 @@
237237
i++;
238238
while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){
239239
pUrlData->port = pUrlData->port*10 + c - '0';
240240
i++;
241241
}
242
- if( c!=0 && c!='/' ) fossil_fatal("url missing '/' after port number");
242
+ if( c!=0 && c!='/' && c!='?' && c!='#' ){
243
+ fossil_fatal("url missing '/' after port number");
244
+ }
243245
/* The HTTP Host: header needs the brackets around an IPv6
244246
** address. For ssh:, the hostname is part of the name of the
245247
** use-path-for-ssh setting, which is stored without them. */
246248
pUrlData->hostname = mprintf("%s%s%s:%d",
247249
pUrlData->isSsh ? "" : zLb,
248250
--- src/url.c
+++ src/url.c
@@ -237,11 +237,13 @@
237 i++;
238 while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){
239 pUrlData->port = pUrlData->port*10 + c - '0';
240 i++;
241 }
242 if( c!=0 && c!='/' ) fossil_fatal("url missing '/' after port number");
 
 
243 /* The HTTP Host: header needs the brackets around an IPv6
244 ** address. For ssh:, the hostname is part of the name of the
245 ** use-path-for-ssh setting, which is stored without them. */
246 pUrlData->hostname = mprintf("%s%s%s:%d",
247 pUrlData->isSsh ? "" : zLb,
248
--- src/url.c
+++ src/url.c
@@ -237,11 +237,13 @@
237 i++;
238 while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){
239 pUrlData->port = pUrlData->port*10 + c - '0';
240 i++;
241 }
242 if( c!=0 && c!='/' && c!='?' && c!='#' ){
243 fossil_fatal("url missing '/' after port number");
244 }
245 /* The HTTP Host: header needs the brackets around an IPv6
246 ** address. For ssh:, the hostname is part of the name of the
247 ** use-path-for-ssh setting, which is stored without them. */
248 pUrlData->hostname = mprintf("%s%s%s:%d",
249 pUrlData->isSsh ? "" : zLb,
250

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button