Fossil SCM
Drop URL fragments ('#', typically an HTML anchor) from address specifiers for http/s and ssh. From libfossil.
Commit
7e13ac5c4efbe1627f0b8019258740b24fe208f72e6a479024c2f159c6e2cd89
Parent
76922609df65114…
1 file changed
+4
+4
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -256,10 +256,14 @@ | ||
| 256 | 256 | pUrlData->hostname = pUrlData->name; |
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | 259 | dehttpize(pUrlData->name); |
| 260 | 260 | pUrlData->path = fossil_strdup(&zUrl[i]); |
| 261 | + /* A fragment (typically an HTML anchor), should not be sent to a server | |
| 262 | + ** (RFC 3986 s 3.5, RFC 9112 s 3.2.1). Drop for these schemes.*/ | |
| 263 | + for(i=0; pUrlData->path[i] && pUrlData->path[i]!='#'; i++){} | |
| 264 | + pUrlData->path[i] = 0; | |
| 261 | 265 | for(i=0; pUrlData->path[i] && pUrlData->path[i]!='?'; i++){} |
| 262 | 266 | if( pUrlData->path[i] ){ |
| 263 | 267 | pUrlData->path[i] = 0; |
| 264 | 268 | i++; |
| 265 | 269 | } |
| 266 | 270 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -256,10 +256,14 @@ | |
| 256 | pUrlData->hostname = pUrlData->name; |
| 257 | } |
| 258 | } |
| 259 | dehttpize(pUrlData->name); |
| 260 | pUrlData->path = fossil_strdup(&zUrl[i]); |
| 261 | for(i=0; pUrlData->path[i] && pUrlData->path[i]!='?'; i++){} |
| 262 | if( pUrlData->path[i] ){ |
| 263 | pUrlData->path[i] = 0; |
| 264 | i++; |
| 265 | } |
| 266 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -256,10 +256,14 @@ | |
| 256 | pUrlData->hostname = pUrlData->name; |
| 257 | } |
| 258 | } |
| 259 | dehttpize(pUrlData->name); |
| 260 | pUrlData->path = fossil_strdup(&zUrl[i]); |
| 261 | /* A fragment (typically an HTML anchor), should not be sent to a server |
| 262 | ** (RFC 3986 s 3.5, RFC 9112 s 3.2.1). Drop for these schemes.*/ |
| 263 | for(i=0; pUrlData->path[i] && pUrlData->path[i]!='#'; i++){} |
| 264 | pUrlData->path[i] = 0; |
| 265 | for(i=0; pUrlData->path[i] && pUrlData->path[i]!='?'; i++){} |
| 266 | if( pUrlData->path[i] ){ |
| 267 | pUrlData->path[i] = 0; |
| 268 | i++; |
| 269 | } |
| 270 |