Fossil SCM

In http_exchange(), remove every trailing /xfer from the Location of a redirect, not only the last one.

dmestas 2026-11-22 11:36 UTC small-fixes
Commit 0e3a63b5261d501c2a430bae0121e2c7c7dbef01dc9d98d06dbe173a61456dd7
1 file changed +2 -2
+2 -2
--- src/http.c
+++ src/http.c
@@ -739,12 +739,12 @@
739739
fossil_warning("malformed redirect: %s", zLine);
740740
goto write_err;
741741
}
742742
j = strlen(zLine) - 1;
743743
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;
746746
}
747747
if( (mHttpFlags & HTTP_QUIET)==0 ){
748748
fossil_print("redirect with status %d to %s\n", rc, &zLine[i]);
749749
}
750750
if( g.url.isFile || g.url.isSsh ){
751751
--- 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

Keyboard Shortcuts

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