Closed LoadLow closed 9 years ago
Why do you want to modify len twice?
Because
r->headers_out.content_type_len = sizeof("text/html") - 1;
Doesn't modify the type_len, because content_type is a struct, we should do :
r->headers_out.content_type.len = sizeof("text/html") - 1;
I've tested without this line many times, and when content_type.len isn't edited, web browsers download the redirect html page as binary file...
thanks, fixed!
Hi, i've found a problem with the content-type length on custom redirections. With this problem, custom redirects are broken because WebBrowsers can't receive the text/html content type (so the file is displayed/downloaded as octet/stream binary file).
instead of :
Fork/Commit with the correct content_type.len : https://github.com/LoadLow/testcookie-nginx-module/commit/bc814568ff038f626cfc29fcc78fbb09709a9d72