Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/dig.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
// Render and return final rows
return `${output(finalRows)}${data.flags.cd
? `\n${DNSSEC_DISABLED_WARNING_MESSAGE}`
: ''}`;
: ''}\n${Array.isArray(data.comment) ? `**Comments:** ${data.comment.join("; ")}` : (data.comment ? `**Comments:** ${data.comment}` : "")}`;

Check failure on line 119 in src/utils/dig.js

View workflow job for this annotation

GitHub Actions / Test

Strings must use singlequote

Check failure on line 119 in src/utils/dig.js

View workflow job for this annotation

GitHub Actions / Test

Strings must use singlequote
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 Two thoughts here:

  1. Instead of the current formatting you have for comments, can we make them formatted as a quote perhaps?
  2. The maxLength / finalRows logic doesn't account for the length of the comments you're appending here.

};

// Convert results to an embed
Expand Down
6 changes: 4 additions & 2 deletions src/utils/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
Question: data.Question,
Answer: data.Answer,
Flags: { cd: !!data.CD },
Comment: data.Comment

Check failure on line 84 in src/utils/dns.js

View workflow job for this annotation

GitHub Actions / Test

Missing trailing comma
}));
};

Expand Down Expand Up @@ -265,21 +266,22 @@
*/
const performLookup = async (domain, type, endpoint, flags) => {
// Make the request
const { Status, Question, Answer, Flags } = await performLookupRequest(domain, type, endpoint, flags);

const { Status, Question, Answer, Flags, Comment } = await performLookupRequest(domain, type, endpoint, flags);
// Return an error message for non-zero status
if (Status !== 0)
return {
name: Question[0].name,
flags: Flags,
message: DNS_RCODES[Status] || `An unexpected error occurred [${Status}]`,
comment: Comment

Check failure on line 276 in src/utils/dns.js

View workflow job for this annotation

GitHub Actions / Test

Missing trailing comma
};

// Valid answer
return {
name: Question[0].name,
flags: Flags,
answer: processAnswer(type, Answer),
comment: Comment

Check failure on line 284 in src/utils/dns.js

View workflow job for this annotation

GitHub Actions / Test

Missing trailing comma
};
};

Expand Down
Loading