Use scheme-relative (aka protocol-relative) URLs for redirects - quark - quark web server
(HTM) git clone git://git.suckless.org/quark
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 4948053bee6d4883d988d104316d11ad9a0ca092
(DIR) parent 72aa1646f69fc738b8df2afaa1b8f4ae9df4c68f
(HTM) Author: Laslo Hunhold <dev@frign.de>
Date: Tue, 27 Feb 2018 03:38:55 +0100
Use scheme-relative (aka protocol-relative) URLs for redirects
This ensures that quark really does not care if the incoming connection
is plain HTTP or relayed TLS-traffic from a proxy or tunnel. Depending
on the previous negotiation, the client will make the right decision on
which scheme to use in a given context.
Diffstat:
M http.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/http.c b/http.c
@@ -391,7 +391,7 @@ http_send_response(int fd, struct request *r)
"HTTP/1.1 %d %s\r\n"
"Date: %s\r\n"
"Connection: close\r\n"
- "Location: http://%s%s%s%s%s%s\r\n"
+ "Location: //%s%s%s%s%s%s\r\n"
"\r\n",
S_MOVED_PERMANENTLY,
status_str[S_MOVED_PERMANENTLY],