@@ -107,7 +107,7 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
107
107
// The CORS library handles all other requests.
108
108
109
109
// Tell the user the allowed methods, and return.
110
- setAllowedHeaders (w , h .cfg .AllowGet )
110
+ setAllowHeader (w , h .cfg .AllowGet )
111
111
w .WriteHeader (http .StatusNoContent )
112
112
return
113
113
case http .MethodPost :
@@ -117,7 +117,7 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
117
117
}
118
118
fallthrough
119
119
default :
120
- setAllowedHeaders (w , h .cfg .AllowGet )
120
+ setAllowHeader (w , h .cfg .AllowGet )
121
121
http .Error (w , "405 - Method Not Allowed" , http .StatusMethodNotAllowed )
122
122
log .Warnf ("The IPFS API does not support %s requests." , r .Method )
123
123
return
@@ -192,7 +192,7 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
192
192
h .root .Call (req , re , h .env )
193
193
}
194
194
195
- func setAllowedHeaders (w http.ResponseWriter , allowGet bool ) {
195
+ func setAllowHeader (w http.ResponseWriter , allowGet bool ) {
196
196
allowedMethods := []string {http .MethodOptions , http .MethodPost }
197
197
if allowGet {
198
198
allowedMethods = append (allowedMethods , http .MethodHead , http .MethodGet )
0 commit comments