• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / dot-block / 27231114288
61%

Build:
DEFAULT BRANCH: main
Ran 09 Jun 2026 07:40PM UTC
Jobs 1
Files 30
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Jun 2026 07:39PM UTC coverage: 60.357% (-0.4%) from 60.736%
27231114288

push

github

web-flow
feat: implement DNS-over-HTTPS (DoH) support (#150)

* feat: implement DNS-over-HTTPS (DoH) support

Added DoH endpoint (`/dns-query`) to the HTTP server to support both GET
 and POST requests. This allows clients to perform DNS lookups over
HTTPS using standard base64-encoded DNS wire format.

- Added `SourceDoH` to `DNSSource`.
- Created `DoHHandler` to parse, resolve, and serialize DNS messages.
- Implemented `doHResponseWriter` to interface with the existing
`DNSDispatcher`.

* refactor: improve DoH request handling and IP parsing

- Update `NewDoHResponseWriter` to accept IP string instead of
`*http.Request` for better testability.
- Simplify DoH handler logic for decoding DNS messages from POST body
and GET parameters.
- Add support for binary DNS message files in `test.http`.
- Apply minor style fixes to `internal/app.go`.

* chore: iterative updates from Gemini based on PR comment

I have added integration tests for both the `GET` and `POST` `/dns-query` endpoints to `internal/integration_test.go`.

### Changes Made:
- **Imports:** Added `bytes`, `encoding/base64`, `io`, and `net/http` to support HTTP requests and DNS message encoding.
- **Configuration:** Updated the test `App` configuration to use a fixed `HttpPort` (8080) to ensure the DoH tests have a reliable endpoint.
- **Test Cases:** Added four new test cases to the `TestIntegration_DNSFunctionality` suite:
    - `DoH GET - Good Domain`
    - `DoH GET - Blocked Domain`
    - `DoH POST - Good Domain`
    - `DoH POST - Blocked Domain`
- **Test Logic:** Implemented the logic to:
    - Pack DNS messages.
    - Perform `GET` requests with base64-encoded DNS queries.
    - Perform `POST` requests with `application/dns-message` bodies.
    - Unpack the response and validate that domains are correctly allowed or blocked (verified by the presence of the `ns.blocked.local.` SOA record).

### Verification:
I ran the integration tests using `go test -v ./internal`, and all tests passed, including ... (continued)

43 of 93 new or added lines in 2 files covered. (46.24%)

1250 of 2071 relevant lines covered (60.36%)

852.06 hits per line

Uncovered Changes

Lines Coverage ∆ File
48
40.74
internal/routes/doh.go
2
61.08
1.63% internal/app.go
Jobs
ID Job ID Ran Files Coverage
1 27231114288.1 09 Jun 2026 07:40PM UTC 30
60.36
GitHub Action Run
Source Files on build 27231114288
  • Tree
  • List 30
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 984cdddf on github
  • Prev Build on main (#27189269258)
  • Next Build on main (#27276150286)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc