Skip to content

Commit

Permalink
fix: handle form-urlencoded content type
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ajnasz committed May 22, 2024
1 parent 29e21b3 commit dba23c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/parsers/createentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down

0 comments on commit dba23c0

Please sign in to comment.