diff options
author | Sorin Neacsu <sorin@users.noreply.github.com> | 2017-12-28 21:15:33 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-12-28 21:15:33 +0800 |
commit | 5369a5c54dca1e7b96680997083035a0f9170d60 (patch) | |
tree | e4143e701d59e6bf3287c93248a4a1758eb40e4c /rpc | |
parent | 9d187f02389ba12493112c7feb15a83f44e3a3ff (diff) | |
download | dexon-5369a5c54dca1e7b96680997083035a0f9170d60.tar.gz dexon-5369a5c54dca1e7b96680997083035a0f9170d60.tar.zst dexon-5369a5c54dca1e7b96680997083035a0f9170d60.zip |
rpc: allow OPTIONS requests without Content-Type (#15759)
Fixes #15740
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/http.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/http.go b/rpc/http.go index a26559b12..d61b0e470 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -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 } |