Skip to content

Commit 41ed581

Browse files
authored
chore: include build version header on subdomain apps (#11172)
Idk why this was not the case before, this is very helpful to have
1 parent fd43985 commit 41ed581

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

coderd/coderd.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -539,20 +539,20 @@ func New(options *Options) *API {
539539
httpmw.ExtractRealIP(api.RealIPConfig),
540540
httpmw.Logger(api.Logger),
541541
prometheusMW,
542-
// SubdomainAppMW checks if the first subdomain is a valid app URL. If
543-
// it is, it will serve that application.
544-
//
545-
// Workspace apps do their own auth and CORS and must be BEFORE the auth
546-
// and CORS middleware.
547-
api.workspaceAppServer.HandleSubdomain(apiRateLimiter),
548-
cors,
549542
// Build-Version is helpful for debugging.
550543
func(next http.Handler) http.Handler {
551544
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
552545
w.Header().Add("X-Coder-Build-Version", buildinfo.Version())
553546
next.ServeHTTP(w, r)
554547
})
555548
},
549+
// SubdomainAppMW checks if the first subdomain is a valid app URL. If
550+
// it is, it will serve that application.
551+
//
552+
// Workspace apps do their own auth and CORS and must be BEFORE the auth
553+
// and CORS middleware.
554+
api.workspaceAppServer.HandleSubdomain(apiRateLimiter),
555+
cors,
556556
// This header stops a browser from trying to MIME-sniff the content type and
557557
// forces it to stick with the declared content-type. This is the only valid
558558
// value for this header.

0 commit comments

Comments
 (0)