diff options
| author | Andrew Clayton <a.clayton@nginx.com> | 2025-07-04 16:38:25 +0100 |
|---|---|---|
| committer | Andrew Clayton <a.clayton@nginx.com> | 2025-07-25 04:49:45 +0100 |
| commit | c8b859e373089d3f347efb806c9926823de41bf6 (patch) | |
| tree | 96f080acede9233e2b13e657ac371f1867fd8a90 /src/ruby/nxt_ruby.c | |
| parent | a9071e11602ec73b96302c852709c16c9d55996d (diff) | |
| download | unit-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/ruby/nxt_ruby.c')
| -rw-r--r-- | src/ruby/nxt_ruby.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ruby/nxt_ruby.c b/src/ruby/nxt_ruby.c index 717816df..c0befdb3 100644 --- a/src/ruby/nxt_ruby.c +++ b/src/ruby/nxt_ruby.c @@ -106,7 +106,6 @@ typedef struct { VALUE *v; } nxt_ruby_string_t; -static VALUE nxt_rb_80_str; static VALUE nxt_rb_content_length_str; static VALUE nxt_rb_content_type_str; static VALUE nxt_rb_http_str; @@ -127,7 +126,6 @@ static VALUE nxt_rb_on_thread_boot; static VALUE nxt_rb_on_thread_shutdown; static nxt_ruby_string_t nxt_rb_strings[] = { - { nxt_string("80"), &nxt_rb_80_str }, { nxt_string("CONTENT_LENGTH"), &nxt_rb_content_length_str }, { nxt_string("CONTENT_TYPE"), &nxt_rb_content_type_str }, { nxt_string("http"), &nxt_rb_http_str }, @@ -754,11 +752,11 @@ nxt_ruby_read_request(nxt_unit_request_info_t *req, VALUE hash_env) r->remote_length); nxt_ruby_add_sptr(hash_env, nxt_rb_server_addr_str, &r->local_addr, r->local_addr_length); + nxt_ruby_add_sptr(hash_env, nxt_rb_server_port_str, &r->local_port, + r->local_port_length); nxt_ruby_add_sptr(hash_env, nxt_rb_server_name_str, &r->server_name, r->server_name_length); - rb_hash_aset(hash_env, nxt_rb_server_port_str, nxt_rb_80_str); - rb_hash_aset(hash_env, nxt_rb_rack_url_scheme_str, r->tls ? nxt_rb_https_str : nxt_rb_http_str); |
