mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 07:11:08 +00:00
cmd/stdiscosrv: Only attempt unescaping when there are %-encodings in the header (fixes #9143)
This commit is contained in:
parent
dc6a10dff4
commit
a405c21ebb
@ -360,9 +360,11 @@ func certificateBytes(req *http.Request) ([]byte, error) {
|
|||||||
// statements. We need to decode, reinstate the newlines every 64
|
// statements. We need to decode, reinstate the newlines every 64
|
||||||
// character and add statements for the PEM decoder
|
// character and add statements for the PEM decoder
|
||||||
|
|
||||||
|
if strings.Contains(hdr, "%") {
|
||||||
if unesc, err := url.QueryUnescape(hdr); err == nil {
|
if unesc, err := url.QueryUnescape(hdr); err == nil {
|
||||||
hdr = unesc
|
hdr = unesc
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for i := 64; i < len(hdr); i += 65 {
|
for i := 64; i < len(hdr); i += 65 {
|
||||||
hdr = hdr[:i] + "\n" + hdr[i:]
|
hdr = hdr[:i] + "\n" + hdr[i:]
|
||||||
|
Loading…
Reference in New Issue
Block a user