Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I try to send a long string(JSON.stringify), the browser reports an error
Steps to reproduce the behavior:
NJS: Here: https://github.com/imzlh/vlist-njs/blob/master/main.ts#L429
CURL:
* Trying 192.168.1.1:81... * Connected to 192.168.1.1 (192.168.1.1) port 81 > POST /@api/?action=slist HTTP/1.1 > Host: 192.168.1.1:81 > User-Agent: curl/8.5.0 > Accept: */* > Content-Length: 26 > Content-Type: application/x-www-form-urlencoded > } [26 bytes data] < HTTP/1.1 200 OK < Server: nginx < Date: Sat, 13 Jul 2024 11:16:55 GMT < Content-Type: application/json; charset=utf-8 < Content-Length: 33829 < Connection: keep-alive < Alt-Svc: h3=":444"; h2=":8443"; ma=86400 < Access-Control-Allow-Origin: * < Access-Control-Allow-Headers: Content-Type, Authorization < { [3798 bytes data] * transfer closed with 6387 bytes remaining to read 81 33855 81 27442 100 26 337k 327 --:--:-- --:--:-- --:--:-- 339k * Closing connection curl: (18) transfer closed with 6387 bytes remaining to read
Complete JSON string
-prefix=/usr/local/osgi/ --sbin-path=bin/ --modules-path=lib/nginx/ --conf-path=etc/nginx/nginx.conf --error-log-path=/tmp/nginx/error.log --pid-path=/tmp/nginx/.pid --lock-path=/tmp/nginx/.lock --user=daemon --group=daemon --build='for ARMRounger' --without-poll_module --without-http_ssi_module --without-http_userid_module --without-http_mirror_module --without-http_geo_module --without-http_map_module --without-http_split_clients_module --without-http_uwsgi_module --without-http_grpc_module --without-http_memcached_module --without-http_empty_gif_module --without-http_browser_module --without-http_upstream_hash_module --without-http_upstream_ip_hash_module --without-http_upstream_least_conn_module --without-http_upstream_random_module --without-http_upstream_keepalive_module --without-http_upstream_zone_module --http-log-path=/tmp/nginx/log.log --http-client-body-temp-path=/tmp/nginx/body --http-proxy-temp-path=/tmp/nginx/proxy --http-fastcgi-temp-path=/tmp/nginx/fcgi --http-scgi-temp-path=/tmp/nginx/scgi --with-cc=armv7m-linux-musleabi-gcc --with-cpp=armv7m-linux-musleabi-gcc-g++ --add-module=../njs/nginx/ --add-module=dav --with-http_dav_module --with-zlib=../zlib-1.3.1 --with-http_v2_module --with-http_v3_module --add-module=fancyindex --with-ld-opt='-static -s -w'
Linux 4.1.25 #3 SMP PREEMPT Fri Apr 7 01:40:44 UTC 2023 armv7l GNU/Linux
The text was updated successfully, but these errors were encountered:
Hi @imzlh,
Can you please minimize the code so I can reproduce the issue? Also please share the minimal nginx.conf.
minal version:
js_import /usr/local/osgi/lib/nginx/vlist.js; location = /@api/{ js_var $authkey "...."; js_content vlist.main; }
return h.return(200, JSON.stringify(res));
Describe the bug
When I try to send a long string(JSON.stringify), the browser reports an error
![image](https://cdn.statically.io/img/private-user-images.githubusercontent.com/114276136/348467880-7eeed4ec-eeda-468f-8822-1652fe7f5ae3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMzNTcxNzgsIm5iZiI6MTcyMzM1Njg3OCwicGF0aCI6Ii8xMTQyNzYxMzYvMzQ4NDY3ODgwLTdlZWVkNGVjLWVlZGEtNDY4Zi04ODIyLTE2NTJmZTdmNWFlMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgxMVQwNjE0MzhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lN2RiZjUzMWExOGYzMGQzMmQ1NWZhMjZkYTM3Y2Y1ZWY4NTdkYmVhMTIzYzIwOWE2YjdiMTMyODYzNWU4MWI5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.2pnVN3pfopD18FcfjsLRv1UVLf-WGOYjaTrMCZ_KeKQ)
To reproduce
Steps to reproduce the behavior:
NJS:
Here: https://github.com/imzlh/vlist-njs/blob/master/main.ts#L429
CURL:
Expected behavior
Complete JSON string
Your environment
configure arguments: -
-prefix=/usr/local/osgi/ --sbin-path=bin/ --modules-path=lib/nginx/ --conf-path=etc/nginx/nginx.conf --error-log-path=/tmp/nginx/error.log --pid-path=/tmp/nginx/.pid --lock-path=/tmp/nginx/.lock --user=daemon --group=daemon --build='for ARMRounger' --without-poll_module --without-http_ssi_module --without-http_userid_module --without-http_mirror_module --without-http_geo_module --without-http_map_module --without-http_split_clients_module --without-http_uwsgi_module --without-http_grpc_module --without-http_memcached_module --without-http_empty_gif_module --without-http_browser_module --without-http_upstream_hash_module --without-http_upstream_ip_hash_module --without-http_upstream_least_conn_module --without-http_upstream_random_module --without-http_upstream_keepalive_module --without-http_upstream_zone_module --http-log-path=/tmp/nginx/log.log --http-client-body-temp-path=/tmp/nginx/body --http-proxy-temp-path=/tmp/nginx/proxy --http-fastcgi-temp-path=/tmp/nginx/fcgi --http-scgi-temp-path=/tmp/nginx/scgi --with-cc=armv7m-linux-musleabi-gcc --with-cpp=armv7m-linux-musleabi-gcc-g++ --add-module=../njs/nginx/ --add-module=dav --with-http_dav_module --with-zlib=../zlib-1.3.1 --with-http_v2_module --with-http_v3_module --add-module=fancyindex --with-ld-opt='-static -s -w'
Linux 4.1.25 #3 SMP PREEMPT Fri Apr 7 01:40:44 UTC 2023 armv7l GNU/Linux
The text was updated successfully, but these errors were encountered: