Skip to content

Commit cbc5172

Browse files
committed
Merge branch 'main' into revert-external-auth-wall
2 parents d113e25 + 4d39da2 commit cbc5172

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4097
-179
lines changed

coderd/apidoc/docs.go

Lines changed: 169 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 156 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/coderd.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,14 @@ func New(options *Options) *API {
10671067
// See globalHTTPSwaggerHandler comment as to why we use a package
10681068
// global variable here.
10691069
r.Get("/swagger/*", globalHTTPSwaggerHandler)
1070+
} else {
1071+
swaggerDisabled := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
1072+
httpapi.Write(context.Background(), rw, http.StatusNotFound, codersdk.Response{
1073+
Message: "Swagger documentation is disabled.",
1074+
})
1075+
})
1076+
r.Get("/swagger", swaggerDisabled)
1077+
r.Get("/swagger/*", swaggerDisabled)
10701078
}
10711079

10721080
// Add CSP headers to all static assets and pages. CSP headers only affect

0 commit comments

Comments
 (0)