Skip to content

Commit

Permalink
rpc: allow OPTIONS requests without Content-Type (ethereum#15759)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorin authored and fjl committed Dec 28, 2017
1 parent 9d187f0 commit 5369a5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rpc/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 5369a5c

Please sign in to comment.