From 354a2e105d26a310501891e6c097eacfd037d8c6 Mon Sep 17 00:00:00 2001 From: David Calavera Date: Mon, 24 Aug 2015 05:57:22 -0400 Subject: [PATCH] Allow HEAD requests to container archives via CORS. Add HEAD to Access-Control-Allow-Methods. Signed-off-by: David Calavera --- api/server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/server/server.go b/api/server/server.go index 66ba4e0842..bf4ec622bf 100644 --- a/api/server/server.go +++ b/api/server/server.go @@ -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) 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-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 {