From 9796e05ca18a08721235fcb11e4ab327e19ca825 Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Mon, 3 Oct 2011 06:38:14 +0200 Subject: [PATCH] added support for X_FORWARDED_SSL in http parser --- proto/http.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proto/http.c b/proto/http.c index 79b144b7..67696484 100644 --- a/proto/http.c +++ b/proto/http.c @@ -46,6 +46,12 @@ static uint16_t http_add_uwsgi_header(struct wsgi_request *wsgi_req, char *hh, i wsgi_req->if_modified_since = val; wsgi_req->if_modified_since_len = vallen; } + else if (!uwsgi_strncmp("X_FORWARDED_SSL", 15, hh, keylen)) { + if (vallen == 2 && val[0] == 'o' && val[1] == 'n') { + wsgi_req->scheme = "https"; + wsgi_req->scheme_len = 5; + } + } else if (uwsgi.vhost_host && !uwsgi_strncmp("HOST", 4, hh, keylen)) { wsgi_req->host = val; wsgi_req->host_len = vallen;