changeset 82:77ed99bd6c71

Correctly handle SERVER_PORT for IPv6 sockets. commit d9346b0b461ea14e234e465e742ee16ec46dacbc
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 14 Jun 2020 22:43:18 +0200
parents 346c4a4ca40b
children 0ad8957eb3a9
files uwsginl/files/patch-proto_http.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl/files/patch-proto_http.c	Sun Jun 14 22:43:18 2020 +0200
@@ -0,0 +1,11 @@
+--- proto/http.c.orig	2020-06-14 20:42:09 UTC
++++ proto/http.c
+@@ -276,7 +276,7 @@ static int http_parse(struct wsgi_request *wsgi_req, c
+                 }
+ 	}
+ 	else {
+-		char *server_port = strchr(wsgi_req->socket->name, ':');
++		char *server_port = strrchr(wsgi_req->socket->name, ':');
+ 		if (server_port) {
+ 			wsgi_req->uh->pktsize += proto_base_add_uwsgi_var(wsgi_req, "SERVER_PORT", 11, server_port+1, strlen(server_port+1));
+ 		}