mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
Fix DoH base64 encoding
This commit is contained in:
parent
d6ef0a28b9
commit
ecbe3fce91
1 changed files with 6 additions and 2 deletions
|
@ -70,9 +70,9 @@ func (hr *HTTPSResolver) Query(ctx context.Context, q *Query) (*RRCache, error)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b64dns := base64.RawStdEncoding.EncodeToString(buf)
|
||||
b64dns := base64.RawURLEncoding.EncodeToString(buf)
|
||||
|
||||
// Build and execute http reuqest
|
||||
// Build and execute http request
|
||||
url := &url.URL{
|
||||
Scheme: "https",
|
||||
Host: hr.resolver.ServerAddress,
|
||||
|
@ -94,6 +94,10 @@ func (hr *HTTPSResolver) Query(ctx context.Context, q *Query) (*RRCache, error)
|
|||
_ = resp.Body.Close()
|
||||
}()
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, fmt.Errorf("http response code %s", resp.Status)
|
||||
}
|
||||
|
||||
// Try to read the result
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue