From 41ed581460ce0715370acd07ea4cbbecaf5c0766 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Wed, 13 Dec 2023 11:45:27 -0600 Subject: [PATCH] chore: include build version header on subdomain apps (#11172) Idk why this was not the case before, this is very helpful to have --- coderd/coderd.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/coderd/coderd.go b/coderd/coderd.go index 747ac04ee8..4475eaf3fa 100644 --- a/coderd/coderd.go +++ b/coderd/coderd.go @@ -539,13 +539,6 @@ func New(options *Options) *API { httpmw.ExtractRealIP(api.RealIPConfig), httpmw.Logger(api.Logger), prometheusMW, - // SubdomainAppMW checks if the first subdomain is a valid app URL. If - // it is, it will serve that application. - // - // Workspace apps do their own auth and CORS and must be BEFORE the auth - // and CORS middleware. - api.workspaceAppServer.HandleSubdomain(apiRateLimiter), - cors, // Build-Version is helpful for debugging. func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -553,6 +546,13 @@ func New(options *Options) *API { next.ServeHTTP(w, r) }) }, + // SubdomainAppMW checks if the first subdomain is a valid app URL. If + // it is, it will serve that application. + // + // Workspace apps do their own auth and CORS and must be BEFORE the auth + // and CORS middleware. + api.workspaceAppServer.HandleSubdomain(apiRateLimiter), + cors, // This header stops a browser from trying to MIME-sniff the content type and // forces it to stick with the declared content-type. This is the only valid // value for this header.