[hackers] [quark] Use scheme-relative (aka protocol-relative) URLs for redirects || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Tue, 27 Feb 2018 03:41:06 +0100 (CET)

commit 4948053bee6d4883d988d104316d11ad9a0ca092
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Tue Feb 27 03:38:55 2018 +0100
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Tue Feb 27 03:38:55 2018 +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.

diff --git a/http.c b/http.c
index 13a77b6..d17a019 100644
--- a/http.c
+++ b/http.c
_AT_@ -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],
Received on Tue Feb 27 2018 - 03:41:06 CET

This archive was generated by hypermail 2.3.0 : Tue Feb 27 2018 - 03:48:22 CET