Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept a wider range of content types for DoH API calls. #3046

Merged
merged 1 commit into from
Dec 17, 2024
Merged
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
8 changes: 8 additions & 0 deletions .changeset/thick-worms-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@atproto-labs/handle-resolver": patch
---

This change makes the DoH handle resolver accept a wider range of content types for DoH API calls.

While there is no agreed upon MIME type for DoH's JSON Schema, this change supports a reasonable
set that include those used by major DoH providers such as Google and Cloudflare.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function dohResolveTxtFactory({
? await response.text()
: `Failed to resolve ${hostname}`
throw new TypeError(message)
} else if (contentType !== 'application/dns-json') {
} else if (contentType?.match(/application\/(dns-)?json/i) == null) {
throw new TypeError('Unexpected response from DoH server')
}

Expand Down
Loading