Fossil

Check-in [1cff8d31]
Login

Check-in [1cff8d31]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1cff8d318232ecfcdd38e9cb5c779fe0b93fd7772e3a1732c9522091ce16cd30
User & Date: drh 2020-12-12 15:25:17
Context
2020-12-12
17:29
serverext.wiki: added a note about the need to unset GATEWAY_INTERFACE before trying to recursively call the fossil binary. ... (check-in: e3fbbdc1 user: stephan tags: trunk)
15:25
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. ... (check-in: 1cff8d31 user: drh tags: trunk)
14:53
In the previous check-in, REQUEST_SCHEMA should be REQUEST_SCHEME - with an "E" at the end, not an "A". ... (check-in: 282bdf01 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/extcgi.c.

325
326
327
328
329
330
331



332
333
334
335
336
337
338
      }else if( fossil_strnicmp(zLine,"Content-Length:",15)==0 ){
        nContent = atoi(&zLine[15]);
      }else if( fossil_strnicmp(zLine,"Content-Type:",13)==0 ){
        int j;
        for(i=13; fossil_isspace(zLine[i]); i++){}
        for(j=i; zLine[j] && zLine[j]!=';'; j++){}
        zMime = mprintf("%.*s", j-i, &zLine[i]);



      }
    }
  }
  blob_read_from_channel(&reply, fromChild, nContent);
  zFailReason = 0;  /* Indicate success */

ext_not_found:







>
>
>







325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
      }else if( fossil_strnicmp(zLine,"Content-Length:",15)==0 ){
        nContent = atoi(&zLine[15]);
      }else if( fossil_strnicmp(zLine,"Content-Type:",13)==0 ){
        int j;
        for(i=13; fossil_isspace(zLine[i]); i++){}
        for(j=i; zLine[j] && zLine[j]!=';'; j++){}
        zMime = mprintf("%.*s", j-i, &zLine[i]);
      }else{
        cgi_append_header(zLine);
        cgi_append_header("\r\n");
      }
    }
  }
  blob_read_from_channel(&reply, fromChild, nContent);
  zFailReason = 0;  /* Indicate success */

ext_not_found: