]> git.kaiwu.me - njs.git/commitdiff
Tests: making sure dns stub in js_fetch_https.t resolves only known hosts.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 9 Oct 2025 01:41:47 +0000 (18:41 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Mon, 27 Oct 2025 16:03:09 +0000 (09:03 -0700)
nginx/t/js_fetch_https.t

index 42b5acbb9664139616864d90b67da42eeceff416..43dcb9f8059ff51c04c485951572880e638b1a41 100644 (file)
@@ -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;