Fossil SCM
After the port number in a URL, now accept '?' and '#' as well as '/' (RFC 3986 section 3.2). From libfossil.
Commit
36beb09dd571f9da9035872ad28f04af8715fbdcc875d04e67db2f609841a0f3
Parent
973e3e972027c5a…
1 file changed
+3
-1
+3
-1
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -237,11 +237,13 @@ | ||
| 237 | 237 | i++; |
| 238 | 238 | while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){ |
| 239 | 239 | pUrlData->port = pUrlData->port*10 + c - '0'; |
| 240 | 240 | i++; |
| 241 | 241 | } |
| 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 | + } | |
| 243 | 245 | /* The HTTP Host: header needs the brackets around an IPv6 |
| 244 | 246 | ** address. For ssh:, the hostname is part of the name of the |
| 245 | 247 | ** use-path-for-ssh setting, which is stored without them. */ |
| 246 | 248 | pUrlData->hostname = mprintf("%s%s%s:%d", |
| 247 | 249 | pUrlData->isSsh ? "" : zLb, |
| 248 | 250 |
| --- 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 |