Skip to content

Commit

Permalink
proxy: imp code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizzick committed May 22, 2024
1 parent 7ff4817 commit bf9bcd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion proxy/server_https.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ func newDNSReq(r *http.Request) (req *dns.Msg, ok bool, statusCode int) {
return nil, false, http.StatusBadRequest
}
case http.MethodPost:
contentType := r.Header.Get("Content-Type")
contentType := r.Header.Get(httphdr.ContentType)
if contentType != "application/dns-message" {
log.Debug("dnsproxy: unsupported media type %q", contentType)

return nil, false, http.StatusUnsupportedMediaType
}

// TODO(d.kolyshev): Limit reader.
buf, err = io.ReadAll(r.Body)
if err != nil {
log.Debug("dnsproxy: reading http request body: %s", err)
Expand Down

0 comments on commit bf9bcd3

Please sign in to comment.