diff options
author | Adam Chlipala <adam@chlipala.net> | 2016-02-14 21:10:46 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2016-02-14 21:10:46 -0500 |
commit | 0ef3c4d155a9ce8cceb225607e97c927fdfe6b1a (patch) | |
tree | f04d33933d07681af55e69a0335b206e81fc059c /src/c | |
parent | 11c4df67ebb9051d0c3cfa6f785b0bf08c5f59fb (diff) |
Fix handling of returnBlob headers for FastCGI, etc.
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/urweb.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index c057688c..a9a169b8 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -3915,9 +3915,18 @@ static char *old_headers(uw_context ctx) { if (uw_buffer_used(&ctx->outHeaders) == 0) return NULL; else { - char *s = strchr(ctx->outHeaders.start, '\n'); + char *s; + int is_good; + + if (strncasecmp(ctx->outHeaders.start, "Content-type: ", 14)) { + s = strchr(ctx->outHeaders.start, '\n'); + is_good = strncasecmp(s+1, "Content-type: ", 14); + } else { + s = ctx->outHeaders.start; + is_good = 1; + } - if (s == NULL || strncasecmp(s+1, "Content-type: ", 14)) + if (!is_good) return NULL; else { s = strchr(s+15, '\n'); |