Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy

This commit is contained in:
Frank Denis 2019-12-01 16:01:38 +01:00
commit ef5bde30a7
2 changed files with 4 additions and 1 deletions

View file

@ -1,7 +1,7 @@
/* /*
* ISC License * ISC License
* *
* Copyright (c) 2018 * Copyright (c) 2018-2019
* Frank Denis <j at pureftpd dot org> * Frank Denis <j at pureftpd dot org>
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any

View file

@ -6,6 +6,7 @@ import (
"io/ioutil" "io/ioutil"
"net" "net"
"net/http" "net/http"
"strings"
"time" "time"
"github.com/jedisct1/dlog" "github.com/jedisct1/dlog"
@ -46,7 +47,9 @@ func (handler localDoHHandler) ServeHTTP(writer http.ResponseWriter, request *ht
writer.WriteHeader(500) writer.WriteHeader(500)
return return
} }
padLen := 127 - (len(response)+127)&127
writer.Header().Set("Content-Type", dataType) writer.Header().Set("Content-Type", dataType)
writer.Header().Set("X-Pad", strings.Repeat("X", padLen))
writer.WriteHeader(200) writer.WriteHeader(200)
writer.Write(response) writer.Write(response)
} }