client: use 307 instead of 302 for HTTPS redirects
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 30 May 2015 21:13:08 +0000 (23:13 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 30 May 2015 21:13:08 +0000 (23:13 +0200)
Use the 307 code to force agents to retain the original request method.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
client.c

index 3dbeb6d24c3cff95dd5a0732ab58598b76e4fb37..dbdd1a3cfe7c8d08c950bc4c93457d31449d1a7f 100644 (file)
--- a/client.c
+++ b/client.c
@@ -264,7 +264,7 @@ static bool tls_redirect_check(struct client *cl)
        cl->request.respond_chunked = false;
        cl->request.connection_close = true;
 
-       uh_http_header(cl, 302, "Found");
+       uh_http_header(cl, 307, "Temporary Redirect");
 
        if (port != 443)
                ustream_printf(cl->us, "Location: https://%s:%d%s\r\n\r\n", host, port, url);