Doesn't respond with SERVFAIL when throwing an error #2

Відкрито
2017-11-02 17:55:51 +00:00 відкрито coolaj86 · 0 коментарів
coolaj86 прокоментував(ла) 2017-11-02 17:55:51 +00:00
Власник

When an error is thrown (such as malformed json data that cannot be written as binary), the server should respond with SERVFAIL

Here's how to observe this error:

Create a db file with bad data (the required field "exchange" is missing from the MX record):

fail.json

{
  "primaryNameservers": [ "localhost" ]
, "domains": [ { "id": "example.com" } ]
, "records": [

    { "zone": "example.com", "name": "example.com", "tld": "com", "sld": "example", "sub": ""
    , "type": "MX", "priority": 10, "MISSING-exchange": "mxa.example.org" }
  ]
}

Installing and running the digd.js server:

git clone https://git.coolaj86.com/coolaj86/digd.js.git

pushd digd.js/

npm install

node bin/digd.js --port 5353 --input fail.json +norecurse

In another terminal, while the server is running:

dig @localhost -p 5353 MX example.com

The server throws an error and nothing comes back. Instead a SERVFAIL should come back.

Note: we should also validate the date... but we should correct the server's handling of error cases before we correct the case that causes an error.

When an error is thrown (such as malformed json data that cannot be written as binary), the server should respond with SERVFAIL Here's how to observe this error: Create a db file with bad data (the required field "exchange" is missing from the MX record): `fail.json` ```json { "primaryNameservers": [ "localhost" ] , "domains": [ { "id": "example.com" } ] , "records": [ { "zone": "example.com", "name": "example.com", "tld": "com", "sld": "example", "sub": "" , "type": "MX", "priority": 10, "MISSING-exchange": "mxa.example.org" } ] } ``` Installing and running the digd.js server: ```bash git clone https://git.coolaj86.com/coolaj86/digd.js.git pushd digd.js/ npm install node bin/digd.js --port 5353 --input fail.json +norecurse ``` In another terminal, while the server is running: ```bash dig @localhost -p 5353 MX example.com ``` The server throws an error and nothing comes back. Instead a SERVFAIL should come back. Note: we should also validate the date... but we should correct the server's handling of error cases _before_ we correct the case that causes an error.
Підпишіться щоб приєднатися до обговорення.
Без мітки
Етап відсутній
Немає виконавця
1 учасників
Сповіщення
Дата завершення
Термін дії не дійсний або знаходиться за межами допустимого діапазону. Будь ласка використовуйте формат 'yyyy-mm-dd'.

Термін виконання не встановлений.

Залежності

No dependencies set.

Reference: coolaj86/digd.js#2
No description provided.