[njs] QuickJS: added xml to nginx modules.

noreply at nginx.com noreply at nginx.com
Fri Apr 4 05:21:02 UTC 2025


details:   https://github.com/nginx/njs/commit/f678c9048b734a6cfff36e6de9ecfe11bed266b4
branches:  master
commit:    f678c9048b734a6cfff36e6de9ecfe11bed266b4
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed, 2 Apr 2025 17:47:10 -0700
description:
QuickJS: added xml to nginx modules.

Missed in cec9a1650.

---
 nginx/config                 | 4 ++++
 nginx/ngx_http_js_module.c   | 3 +++
 nginx/ngx_js.h               | 1 +
 nginx/ngx_stream_js_module.c | 3 +++
 4 files changed, 11 insertions(+)

diff --git a/nginx/config b/nginx/config
index 2edf7a3d..03ec03d0 100644
--- a/nginx/config
+++ b/nginx/config
@@ -129,6 +129,10 @@ if [ $NJS_LIBXSLT != NO ]; then
     have=NJS_HAVE_XML . auto/have
     NJS_SRCS="$NJS_SRCS $ngx_addon_dir/../external/njs_xml_module.c"
 
+    if [ "$NJS_HAVE_QUICKJS" = "YES" ];  then
+        NJS_SRCS="$NJS_SRCS $ngx_addon_dir/../external/qjs_xml_module.c"
+    fi
+
     echo " enabled xml module"
 fi
 
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index 0c8215c5..5a131bc9 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -1140,6 +1140,9 @@ qjs_module_t *njs_http_qjs_addon_modules[] = {
 #ifdef NJS_HAVE_OPENSSL
     &qjs_webcrypto_module,
 #endif
+#ifdef NJS_HAVE_XML
+    &qjs_xml_module,
+#endif
 #ifdef NJS_HAVE_ZLIB
     &qjs_zlib_module,
 #endif
diff --git a/nginx/ngx_js.h b/nginx/ngx_js.h
index 51b8916c..0a99a696 100644
--- a/nginx/ngx_js.h
+++ b/nginx/ngx_js.h
@@ -378,6 +378,7 @@ ngx_int_t ngx_qjs_string(JSContext *cx, JSValueConst val, ngx_str_t *str);
     ((ngx_js_external_ctx_pt) ngx_qjs_meta(cx, 11))(e)
 
 extern qjs_module_t  qjs_webcrypto_module;
+extern qjs_module_t  qjs_xml_module;
 extern qjs_module_t  qjs_zlib_module;
 extern qjs_module_t  ngx_qjs_ngx_module;
 extern qjs_module_t  ngx_qjs_ngx_shared_dict_module;
diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c
index b1e175d2..44c7af17 100644
--- a/nginx/ngx_stream_js_module.c
+++ b/nginx/ngx_stream_js_module.c
@@ -841,6 +841,9 @@ qjs_module_t *njs_stream_qjs_addon_modules[] = {
 #ifdef NJS_HAVE_OPENSSL
     &qjs_webcrypto_module,
 #endif
+#ifdef NJS_HAVE_XML
+    &qjs_xml_module,
+#endif
 #ifdef NJS_HAVE_ZLIB
     &qjs_zlib_module,
 #endif


More information about the nginx-devel mailing list