Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit900709b

Browse files
committed
Attach rate limiter outside the pkg
1 parent70309ce commit900709b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎coderd/coderd.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,10 @@ func New(options *Options) *API {
404404
r.Get("/healthz",func(w http.ResponseWriter,r*http.Request) {_,_=w.Write([]byte("OK")) })
405405

406406
// Attach workspace apps routes.
407-
workspaceAppServer.Attach(r,apiRateLimiter)
407+
r.Group(func(r chi.Router) {
408+
r.Use(apiKeyMiddleware)
409+
workspaceAppServer.Attach(r)
410+
})
408411

409412
r.Route("/derp",func(r chi.Router) {
410413
r.Get("/",derpHandler.ServeHTTP)

‎coderd/workspaceapps/proxy.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ type Server struct {
8686
AppSigningKeySigningKey
8787
}
8888

89-
func (s*Server)Attach(r chi.Router,pathAppRateLimiterfunc(http.Handler) http.Handler) {
89+
func (s*Server)Attach(r chi.Router) {
9090
servePathApps:=func(r chi.Router) {
91-
r.Use(pathAppRateLimiter)
9291
r.HandleFunc("/*",s.workspaceAppsProxyPath)
9392
}
9493

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp