From c8b859e373089d3f347efb806c9926823de41bf6 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Fri, 4 Jul 2025 16:38:25 +0100 Subject: Set SERVER_PORT appropriately The Perl, PHP, Python, Ruby & Java language modules all hard code SERVER_PORT to "80". Adjust them to bring them in line with the wasm language module which uses r->local_port (I.e. the port unit accepted the connection on). Closes: https://github.com/nginx/unit/issues/761 Signed-off-by: Andrew Clayton --- src/perl/nxt_perl_psgi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/perl/nxt_perl_psgi.c') diff --git a/src/perl/nxt_perl_psgi.c b/src/perl/nxt_perl_psgi.c index 587656cd..c16b2173 100644 --- a/src/perl/nxt_perl_psgi.c +++ b/src/perl/nxt_perl_psgi.c @@ -673,7 +673,8 @@ nxt_perl_psgi_env_create(PerlInterpreter *my_perl, RC(nxt_perl_psgi_add_sptr(my_perl, hash_env, NL("SERVER_NAME"), &r->server_name, r->server_name_length)); - RC(nxt_perl_psgi_add_str(my_perl, hash_env, NL("SERVER_PORT"), "80", 2)); + RC(nxt_perl_psgi_add_sptr(my_perl, hash_env, NL("SERVER_PORT"), + &r->local_port, r->local_port_length)); for (i = 0; i < r->fields_count; i++) { f = r->fields + i; -- cgit