When a "Location" header was found in a FCGI response, the status code was
forced to 302. But it should only be performed if no status code was set
first.
So now, we take care to not override an already defined status code when the
"Location" header is found.
This patch should fix the issue #2865. It must backported to all stable
versions.
if (isteqi(hdrs[hdr].n, ist("status"))) {
code = http_parse_status_val(hdrs[hdr].v, &status, &reason);
}
- else if (isteqi(hdrs[hdr].n, ist("location"))) {
+ else if (isteqi(hdrs[hdr].n, ist("location")) && !code) {
code = 302;
status = ist("302");
reason = ist("Found");