miekg / dns

DNS library in Go
https://miek.nl/2014/august/16/go-dns-package
BSD 3-Clause "New" or "Revised" License
7.86k stars 1.12k forks source link

Request timeout middleware dns.HandlerFunc #1539

Closed jimlambrt closed 3 months ago

jimlambrt commented 4 months ago

Is there any desire to include a sort of middleware dns.HandlerFunc which provides support for request timeouts via a request context?

It's a pretty straightforward thing to make and I've pulled something together which I'm happy to contribute via a PR (and get rid of my pkg). Let me know if there's any interest and I'll open a PR.

Here's what I'm proposing to contribute: github.com/jimlambrt/respwriter

miekg commented 3 months ago

coredns implements a whole bunch of middlewares, I don't think it makes sense to pull more into this package. I mean if we pull this in, where do we stop?