From: Dmitry Volyntsev Date: Thu, 9 Oct 2025 01:41:47 +0000 (-0700) Subject: Tests: making sure dns stub in js_fetch_https.t resolves only known hosts. X-Git-Tag: 0.9.4~6 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=36893bf2b7d05d217e8cc487518ca155407786e0;p=njs.git Tests: making sure dns stub in js_fetch_https.t resolves only known hosts. --- diff --git a/nginx/t/js_fetch_https.t b/nginx/t/js_fetch_https.t index 42b5acbb..43dcb9f8 100644 --- a/nginx/t/js_fetch_https.t +++ b/nginx/t/js_fetch_https.t @@ -241,8 +241,15 @@ sub reply_handler { my $name = join('.', @name); - if ($type == A) { - push @rdata, rd_addr($ttl, '127.0.0.1'); + if ($name eq 'default.example.com' || $name eq '1.example.com') { + if ($type == A) { + push @rdata, rd_addr($ttl, '127.0.0.1'); + } + + } elsif ($name eq 'localhost') { + if ($type == A) { + push @rdata, rd_addr($ttl, '127.0.0.1'); + } } $len = @name;