aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_http_js_module.c
diff options
context:
space:
mode:
authorDmitry Volyntsev <xeioex@nginx.com>2020-09-11 13:54:57 +0000
committerDmitry Volyntsev <xeioex@nginx.com>2020-09-11 13:54:57 +0000
commitea61279dd69a99aa0b131f2f137b3e3a208b7f6f (patch)
treec26632aded1f76afc3251631ffeb98261065cf14 /nginx/ngx_http_js_module.c
parentf9d4fa4466fea0a2d908ead78028ee1d2139fe15 (diff)
downloadnjs-ea61279dd69a99aa0b131f2f137b3e3a208b7f6f.tar.gz
njs-ea61279dd69a99aa0b131f2f137b3e3a208b7f6f.zip
HTTP: added support for http/2 and http/3 in r.httpVersion.
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r--nginx/ngx_http_js_module.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index 98eedfc3..e9132fd8 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -1912,9 +1912,23 @@ ngx_http_js_ext_get_http_version(njs_vm_t *vm, njs_object_prop_t *prop,
ngx_str_set(&v, "1.0");
break;
- default: /* NGX_HTTP_VERSION_11 */
+ case NGX_HTTP_VERSION_11:
ngx_str_set(&v, "1.1");
break;
+
+ case NGX_HTTP_VERSION_20:
+ ngx_str_set(&v, "2.0");
+ break;
+
+#if (NGX_HTTP_VERSION_30)
+ case NGX_HTTP_VERSION_30:
+ ngx_str_set(&v, "3.0");
+ break;
+#endif
+
+ default:
+ ngx_str_set(&v, "");
+ break;
}
return njs_vm_value_string_set(vm, retval, v.data, v.len);