summaryrefslogtreecommitdiffhomepage
path: root/src/perl/nxt_perl_psgi.c
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2025-07-04 16:38:25 +0100
committerAndrew Clayton <a.clayton@nginx.com>2025-07-25 04:49:45 +0100
commitc8b859e373089d3f347efb806c9926823de41bf6 (patch)
tree96f080acede9233e2b13e657ac371f1867fd8a90 /src/perl/nxt_perl_psgi.c
parenta9071e11602ec73b96302c852709c16c9d55996d (diff)
downloadunit-c8b859e373089d3f347efb806c9926823de41bf6.tar.gz
unit-c8b859e373089d3f347efb806c9926823de41bf6.tar.bz2
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 <a.clayton@nginx.com>
Diffstat (limited to 'src/perl/nxt_perl_psgi.c')
-rw-r--r--src/perl/nxt_perl_psgi.c3
1 files changed, 2 insertions, 1 deletions
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;