From dba23c0b308168f36ad809e34e0b505478fa25f1 Mon Sep 17 00:00:00 2001 From: Lajos Koszti Date: Wed, 22 May 2024 08:11:15 +0200 Subject: [PATCH] fix: handle form-urlencoded content type The default header by curl is application/x-www-form-urlencoded, so when we send a secret without a specific header this was saved and then served by the server on secret read. Set the default content to the requested data when the content type header was set to form-urlencoded --- internal/parsers/createentry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/parsers/createentry.go b/internal/parsers/createentry.go index 3429c28..67c9ceb 100644 --- a/internal/parsers/createentry.go +++ b/internal/parsers/createentry.go @@ -51,7 +51,7 @@ func parseMultiForm(r *http.Request) ([]byte, string, error) { func getContentType(r *http.Request) string { ct := r.Header.Get("content-type") - if ct == "" { + if ct == "" || ct == "application/x-www-form-urlencoded" { ct = "application/octet-stream" }