Allow HEAD requests to container archives via CORS.

Add HEAD to Access-Control-Allow-Methods.

Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
David Calavera 2015-08-24 05:57:22 -04:00
parent 888d1d0e20
commit 354a2e105d
1 changed files with 1 additions and 1 deletions

View File

@ -227,7 +227,7 @@ func writeCorsHeaders(w http.ResponseWriter, r *http.Request, corsHeaders string
logrus.Debugf("CORS header is enabled and set to: %s", corsHeaders) logrus.Debugf("CORS header is enabled and set to: %s", corsHeaders)
w.Header().Add("Access-Control-Allow-Origin", corsHeaders) w.Header().Add("Access-Control-Allow-Origin", corsHeaders)
w.Header().Add("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth") w.Header().Add("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth")
w.Header().Add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, OPTIONS") w.Header().Add("Access-Control-Allow-Methods", "HEAD, GET, POST, DELETE, PUT, OPTIONS")
} }
func (s *Server) ping(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error { func (s *Server) ping(version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {