]> git.kaiwu.me - njs.git/commit
Tests: distinguish WebCrypto absence from probe failures
authorDmitry Volyntsev <xeioex@nginx.com>
Sat, 24 Oct 2026 05:45:29 +0000 (22:45 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Thu, 19 Nov 2026 06:44:10 +0000 (22:44 -0800)
commit260b437b0ab2d76a37873007ce56edcec50decf4
tree2792bfecd7a450cbe1fd4fd64dfb66fd071352fc
parente46cdc6f1a72579083a864b7965ffae70da03ffc
Tests: distinguish WebCrypto absence from probe failures

The capability guards introduced in 4ea1356a skipped whenever the HTTP
response did not contain "true".  A startup error, HTTP 500 or malformed
response could therefore hide a regression.  Referencing an absent
crypto global also raised ReferenceError instead of returning false.

Use typeof to check the global and accept only a successful response
with an exact boolean body.  Probe WebCrypto through stream in the
stream test, independently of HTTP engine selection.  Treat startup
and malformed probe responses as failures.

Require WebCrypto when the existing CI_SSL setting is yes.  Keep a
capability skip for a valid false response outside SSL-enabled CI,
so local builds without crypto remain supported.
nginx/t/js_webcrypto.t
nginx/t/stream_js_webcrypto.t