Fossil SCM
In http_exchange(), remove every trailing /xfer from the Location of a redirect, not only the last one.
Commit
0e3a63b5261d501c2a430bae0121e2c7c7dbef01dc9d98d06dbe173a61456dd7
Parent
fabf3e1d5117997…
1 file changed
+2
-2
+2
-2
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -739,12 +739,12 @@ | ||
| 739 | 739 | fossil_warning("malformed redirect: %s", zLine); |
| 740 | 740 | goto write_err; |
| 741 | 741 | } |
| 742 | 742 | j = strlen(zLine) - 1; |
| 743 | 743 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 744 | - j -= 4; | |
| 745 | - zLine[j] = 0; | |
| 744 | + j -= 5; | |
| 745 | + zLine[j+1] = 0; | |
| 746 | 746 | } |
| 747 | 747 | if( (mHttpFlags & HTTP_QUIET)==0 ){ |
| 748 | 748 | fossil_print("redirect with status %d to %s\n", rc, &zLine[i]); |
| 749 | 749 | } |
| 750 | 750 | if( g.url.isFile || g.url.isSsh ){ |
| 751 | 751 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -739,12 +739,12 @@ | |
| 739 | fossil_warning("malformed redirect: %s", zLine); |
| 740 | goto write_err; |
| 741 | } |
| 742 | j = strlen(zLine) - 1; |
| 743 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 744 | j -= 4; |
| 745 | zLine[j] = 0; |
| 746 | } |
| 747 | if( (mHttpFlags & HTTP_QUIET)==0 ){ |
| 748 | fossil_print("redirect with status %d to %s\n", rc, &zLine[i]); |
| 749 | } |
| 750 | if( g.url.isFile || g.url.isSsh ){ |
| 751 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -739,12 +739,12 @@ | |
| 739 | fossil_warning("malformed redirect: %s", zLine); |
| 740 | goto write_err; |
| 741 | } |
| 742 | j = strlen(zLine) - 1; |
| 743 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 744 | j -= 5; |
| 745 | zLine[j+1] = 0; |
| 746 | } |
| 747 | if( (mHttpFlags & HTTP_QUIET)==0 ){ |
| 748 | fossil_print("redirect with status %d to %s\n", rc, &zLine[i]); |
| 749 | } |
| 750 | if( g.url.isFile || g.url.isSsh ){ |
| 751 |