From acfcc955deeda2987733993fd1d04459bf98c662 Mon Sep 17 00:00:00 2001 From: Josh Hawn Date: Tue, 20 Jan 2015 12:05:12 -0800 Subject: [PATCH] Add Docker Distribution API Version header Setting a header for all responses can help clients better determine if the server speaks the legacy v1 API or the v2 API. It is important that the header be set *BEFORE* routing the request. Docker-DCO-1.1-Signed-off-by: Josh Hawn (github: jlhawn) --- docs/app.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/app.go b/docs/app.go index 6a79cdfab..051127313 100644 --- a/docs/app.go +++ b/docs/app.go @@ -88,6 +88,8 @@ func NewApp(configuration configuration.Configuration) *App { } func (app *App) ServeHTTP(w http.ResponseWriter, r *http.Request) { + // Set a header with the Docker Distribution API Version for all responses. + w.Header().Add("Docker-Distribution-API-Version", "registry/2.0") app.router.ServeHTTP(w, r) }