mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: allow cross-origin requests between users' own apps (#7688)
This commit is contained in:
+3
-3
@@ -408,7 +408,6 @@ func New(options *Options) *API {
|
||||
prometheusMW := httpmw.Prometheus(options.PrometheusRegistry)
|
||||
|
||||
r.Use(
|
||||
cors,
|
||||
httpmw.Recover(api.Logger),
|
||||
tracing.StatusWriterMiddleware,
|
||||
tracing.Middleware(api.TracerProvider),
|
||||
@@ -419,9 +418,10 @@ func New(options *Options) *API {
|
||||
// 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 must be BEFORE the auth
|
||||
// middleware.
|
||||
// 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) {
|
||||
|
||||
Reference in New Issue
Block a user