Skip to content

Commit 944ad1d

Browse files
ibnesayeedStebalien
authored andcommitted
Rename setAllowedHeaders to setAllowHeader to better reflect the purpose
1 parent f36ceb1 commit 944ad1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

http/handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
107107
// The CORS library handles all other requests.
108108

109109
// Tell the user the allowed methods, and return.
110-
setAllowedHeaders(w, h.cfg.AllowGet)
110+
setAllowHeader(w, h.cfg.AllowGet)
111111
w.WriteHeader(http.StatusNoContent)
112112
return
113113
case http.MethodPost:
@@ -117,7 +117,7 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
117117
}
118118
fallthrough
119119
default:
120-
setAllowedHeaders(w, h.cfg.AllowGet)
120+
setAllowHeader(w, h.cfg.AllowGet)
121121
http.Error(w, "405 - Method Not Allowed", http.StatusMethodNotAllowed)
122122
log.Warnf("The IPFS API does not support %s requests.", r.Method)
123123
return
@@ -192,7 +192,7 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
192192
h.root.Call(req, re, h.env)
193193
}
194194

195-
func setAllowedHeaders(w http.ResponseWriter, allowGet bool) {
195+
func setAllowHeader(w http.ResponseWriter, allowGet bool) {
196196
allowedMethods := []string{http.MethodOptions, http.MethodPost}
197197
if allowGet {
198198
allowedMethods = append(allowedMethods, http.MethodHead, http.MethodGet)

0 commit comments

Comments
 (0)