efree(mimetype);
SG(sapi_headers).send_default_content_type = 0;
} else if (!STRCASECMP(header_line, "Location")) {
- if (SG(sapi_headers).http_response_code < 300 ||
- SG(sapi_headers).http_response_code > 307) {
+ if ((SG(sapi_headers).http_response_code < 300 ||
+ SG(sapi_headers).http_response_code > 307) &&
+ SG(sapi_headers).http_response_code != 201) {
/* Return a Found Redirect if one is not already specified */
sapi_update_response_code(302 TSRMLS_CC);
}