mirror of
https://github.com/openfaas/faas.git
synced 2025-06-22 23:03:24 +00:00
Use http package consts for http methods
This commit replaces occurences of http method strings with the corresponding consts from the http package. *Note* UPDATE is not strictly speaking a valid method and as such isn't part of the http package (should be a PUT or PATCH?) Signed-off-by: John McCabe <john@johnmccabe.net>
This commit is contained in:
@ -11,7 +11,7 @@ type CORSHandler struct {
|
||||
func (c CORSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// https://raw.githubusercontent.com/openfaas/store/master/store.json
|
||||
w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET")
|
||||
w.Header().Set("Access-Control-Allow-Methods", http.MethodGet)
|
||||
w.Header().Set("Access-Control-Allow-Origin", c.AllowedHost)
|
||||
|
||||
(*c.Upstream).ServeHTTP(w, r)
|
||||
|
Reference in New Issue
Block a user