mirror of
https://github.com/tailscale/tailscale.git
synced 2025-06-09 09:18:36 +00:00
ipn/ipnlocal: improve dohQuery error to suggest ?dns=
and ?q=
(#16056)
Previously, a missing or invalid `dns` parameter on GET `/dns-query` returned only “missing ‘dns’ parameter”. Now the error message guides users to use `?dns=` or `?q=`. Updates: #16055 Signed-off-by: Zach Buchheit <zachb@tailscale.com>
This commit is contained in:
parent
00a7dd180a
commit
4a11514db5
@ -859,7 +859,7 @@ func dohQuery(r *http.Request) (dnsQuery []byte, publicErr string) {
|
|||||||
case "GET":
|
case "GET":
|
||||||
q64 := r.FormValue("dns")
|
q64 := r.FormValue("dns")
|
||||||
if q64 == "" {
|
if q64 == "" {
|
||||||
return nil, "missing 'dns' parameter"
|
return nil, "missing ‘dns’ parameter; try '?dns=' (DoH standard) or use '?q=<name>' for JSON debug mode"
|
||||||
}
|
}
|
||||||
if base64.RawURLEncoding.DecodedLen(len(q64)) > maxQueryLen {
|
if base64.RawURLEncoding.DecodedLen(len(q64)) > maxQueryLen {
|
||||||
return nil, "query too large"
|
return nil, "query too large"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user