Fossil SCM
Make sure an HTTP request always has at least a single "/" in the pathname.
Commit
35d609a0ba81799be0992ea4b63ca425d2aff9e3127962feb21e9d4217c0b48f
Parent
cd11f9218670d52…
1 file changed
+3
-2
+3
-2
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -116,12 +116,13 @@ | ||
| 116 | 116 | const char *zAltMimetype /* Alternative mimetype */ |
| 117 | 117 | ){ |
| 118 | 118 | int nPayload = pPayload ? blob_size(pPayload) : 0; |
| 119 | 119 | |
| 120 | 120 | blob_zero(pHdr); |
| 121 | - blob_appendf(pHdr, "%s %s HTTP/1.0\r\n", | |
| 122 | - nPayload>0 ? "POST" : "GET", g.url.path); | |
| 121 | + blob_appendf(pHdr, "%s %s%s HTTP/1.0\r\n", | |
| 122 | + nPayload>0 ? "POST" : "GET", g.url.path, | |
| 123 | + g.url.path[0]==0 ? "/" : ""); | |
| 123 | 124 | if( g.url.proxyAuth ){ |
| 124 | 125 | blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.url.proxyAuth); |
| 125 | 126 | } |
| 126 | 127 | if( g.zHttpAuth && g.zHttpAuth[0] ){ |
| 127 | 128 | const char *zCredentials = g.zHttpAuth; |
| 128 | 129 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -116,12 +116,13 @@ | |
| 116 | const char *zAltMimetype /* Alternative mimetype */ |
| 117 | ){ |
| 118 | int nPayload = pPayload ? blob_size(pPayload) : 0; |
| 119 | |
| 120 | blob_zero(pHdr); |
| 121 | blob_appendf(pHdr, "%s %s HTTP/1.0\r\n", |
| 122 | nPayload>0 ? "POST" : "GET", g.url.path); |
| 123 | if( g.url.proxyAuth ){ |
| 124 | blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.url.proxyAuth); |
| 125 | } |
| 126 | if( g.zHttpAuth && g.zHttpAuth[0] ){ |
| 127 | const char *zCredentials = g.zHttpAuth; |
| 128 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -116,12 +116,13 @@ | |
| 116 | const char *zAltMimetype /* Alternative mimetype */ |
| 117 | ){ |
| 118 | int nPayload = pPayload ? blob_size(pPayload) : 0; |
| 119 | |
| 120 | blob_zero(pHdr); |
| 121 | blob_appendf(pHdr, "%s %s%s HTTP/1.0\r\n", |
| 122 | nPayload>0 ? "POST" : "GET", g.url.path, |
| 123 | g.url.path[0]==0 ? "/" : ""); |
| 124 | if( g.url.proxyAuth ){ |
| 125 | blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.url.proxyAuth); |
| 126 | } |
| 127 | if( g.zHttpAuth && g.zHttpAuth[0] ){ |
| 128 | const char *zCredentials = g.zHttpAuth; |
| 129 |