Remove raw cert escape in PassTLSClientCert middleware
This commit is contained in:
parent
87815586be
commit
2c550c284d
8 changed files with 17 additions and 19 deletions
|
@ -325,13 +325,11 @@ func writePart(ctx context.Context, content io.StringWriter, entry, prefix strin
|
|||
|
||||
// sanitize As we pass the raw certificates, remove the useless data and make it http request compliant.
|
||||
func sanitize(cert []byte) string {
|
||||
cleaned := strings.NewReplacer(
|
||||
return strings.NewReplacer(
|
||||
"-----BEGIN CERTIFICATE-----", "",
|
||||
"-----END CERTIFICATE-----", "",
|
||||
"\n", "",
|
||||
).Replace(string(cert))
|
||||
|
||||
return url.QueryEscape(cleaned)
|
||||
}
|
||||
|
||||
// getCertificates Build a string with the client certificates.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue