good morning!!!!

Skip to content
Snippets Groups Projects
Commit 5369a5c5 authored by Sorin Neacsu's avatar Sorin Neacsu Committed by Felix Lange
Browse files

rpc: allow OPTIONS requests without Content-Type (#15759)

Fixes #15740
parent 9d187f02
No related branches found
No related tags found
No related merge requests found
......@@ -177,7 +177,7 @@ func validateRequest(r *http.Request) (int, error) {
return http.StatusRequestEntityTooLarge, err
}
mt, _, err := mime.ParseMediaType(r.Header.Get("content-type"))
if err != nil || mt != contentType {
if r.Method != http.MethodOptions && (err != nil || mt != contentType) {
err := fmt.Errorf("invalid content type, only %s is supported", contentType)
return http.StatusUnsupportedMediaType, err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment