Fossil SCM
For the CGI handler in the extension CGI mechanism, unrecognized header strings coming back from the CGI program are passed through unaltered to the HTTP reply. This allows the CGI program to set cookies.
Commit
1cff8d318232ecfcdd38e9cb5c779fe0b93fd7772e3a1732c9522091ce16cd30
Parent
282bdf01656ebcd…
1 file changed
+3
+3
| --- src/extcgi.c | ||
| +++ src/extcgi.c | ||
| @@ -327,10 +327,13 @@ | ||
| 327 | 327 | }else if( fossil_strnicmp(zLine,"Content-Type:",13)==0 ){ |
| 328 | 328 | int j; |
| 329 | 329 | for(i=13; fossil_isspace(zLine[i]); i++){} |
| 330 | 330 | for(j=i; zLine[j] && zLine[j]!=';'; j++){} |
| 331 | 331 | zMime = mprintf("%.*s", j-i, &zLine[i]); |
| 332 | + }else{ | |
| 333 | + cgi_append_header(zLine); | |
| 334 | + cgi_append_header("\r\n"); | |
| 332 | 335 | } |
| 333 | 336 | } |
| 334 | 337 | } |
| 335 | 338 | blob_read_from_channel(&reply, fromChild, nContent); |
| 336 | 339 | zFailReason = 0; /* Indicate success */ |
| 337 | 340 |
| --- src/extcgi.c | |
| +++ src/extcgi.c | |
| @@ -327,10 +327,13 @@ | |
| 327 | }else if( fossil_strnicmp(zLine,"Content-Type:",13)==0 ){ |
| 328 | int j; |
| 329 | for(i=13; fossil_isspace(zLine[i]); i++){} |
| 330 | for(j=i; zLine[j] && zLine[j]!=';'; j++){} |
| 331 | zMime = mprintf("%.*s", j-i, &zLine[i]); |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | blob_read_from_channel(&reply, fromChild, nContent); |
| 336 | zFailReason = 0; /* Indicate success */ |
| 337 |
| --- src/extcgi.c | |
| +++ src/extcgi.c | |
| @@ -327,10 +327,13 @@ | |
| 327 | }else if( fossil_strnicmp(zLine,"Content-Type:",13)==0 ){ |
| 328 | int j; |
| 329 | for(i=13; fossil_isspace(zLine[i]); i++){} |
| 330 | for(j=i; zLine[j] && zLine[j]!=';'; j++){} |
| 331 | zMime = mprintf("%.*s", j-i, &zLine[i]); |
| 332 | }else{ |
| 333 | cgi_append_header(zLine); |
| 334 | cgi_append_header("\r\n"); |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | blob_read_from_channel(&reply, fromChild, nContent); |
| 339 | zFailReason = 0; /* Indicate success */ |
| 340 |