Skip to content

Commit b4f9615

Browse files
committed
Add app proxying for wildcards
1 parent 4b73034 commit b4f9615

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

coderd/coderd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func New(options *Options) *API {
104104
httpmw.ExtractUserParam(api.Database),
105105
authRolesMiddleware,
106106
)
107-
r.Get("/", api.workspaceAppsProxyPath)
107+
r.Get("/*", api.workspaceAppsProxyPath)
108108
})
109109

110110
r.Route("/api/v2", func(r chi.Router) {

coderd/workspaceapps.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ func (api *API) workspaceAppsProxyPath(rw http.ResponseWriter, r *http.Request)
126126
if !valid {
127127
panic("dev error: default transport isn't a transport")
128128
}
129+
129130
transport := defaultTransport.Clone()
130131
transport.DialContext = conn.DialContext
131132
proxy.Transport = transport
133+
r.URL.Path = chi.URLParam(r, "*")
132134
proxy.ServeHTTP(rw, r)
133135
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy