mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #3771 from yichengq/cors-auth
pkg/cors: add authorization into Access-Control-Allow-Headers
This commit is contained in:
commit
7ff8ec81ee
@ -65,7 +65,7 @@ type CORSHandler struct {
|
|||||||
func (h *CORSHandler) addHeader(w http.ResponseWriter, origin string) {
|
func (h *CORSHandler) addHeader(w http.ResponseWriter, origin string) {
|
||||||
w.Header().Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
|
w.Header().Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
|
||||||
w.Header().Add("Access-Control-Allow-Origin", origin)
|
w.Header().Add("Access-Control-Allow-Origin", origin)
|
||||||
w.Header().Add("Access-Control-Allow-Headers", "accept, content-type")
|
w.Header().Add("Access-Control-Allow-Headers", "accept, content-type, authorization")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServeHTTP adds the correct CORS headers based on the origin and returns immediately
|
// ServeHTTP adds the correct CORS headers based on the origin and returns immediately
|
||||||
|
Loading…
x
Reference in New Issue
Block a user