Skip to content

Commit 21c63a5

Browse files
committed
Local-DoH: pad responses
1 parent f9019f4 commit 21c63a5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

dnscrypt-proxy/local-doh.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"io/ioutil"
77
"net"
88
"net/http"
9+
"strings"
910
"time"
1011

1112
"github.com/jedisct1/dlog"
@@ -46,7 +47,9 @@ func (handler localDoHHandler) ServeHTTP(writer http.ResponseWriter, request *ht
4647
writer.WriteHeader(500)
4748
return
4849
}
50+
padLen := 127 - (len(response)+127)&127
4951
writer.Header().Set("Content-Type", dataType)
52+
writer.Header().Set("X-Pad", strings.Repeat("X", padLen))
5053
writer.WriteHeader(200)
5154
writer.Write(response)
5255
}

0 commit comments

Comments
 (0)