Skip to content

Commit ede6cac

Browse files
sagor999roboquat
authored andcommitted
[ws-proxy] fix ACME challenge handler
1 parent f9c93c4 commit ede6cac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/ws-proxy/pkg/proxy/workspacerouter.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ func HostBasedRouter(header, wsHostSuffix string, wsHostSuffixRegex string) Work
4949
allClusterWsHostSuffixRegex = wsHostSuffix
5050
}
5151

52+
// make sure acme router is the first handler setup to make sure it has a chance to catch acme challenge
53+
setupAcmeRouter(r)
54+
5255
var (
5356
getHostHeader = func(req *http.Request) string {
5457
host := req.Header.Get(header)
@@ -64,8 +67,6 @@ func HostBasedRouter(header, wsHostSuffix string, wsHostSuffixRegex string) Work
6467
ideRouter = r.MatcherFunc(matchWorkspaceHostHeader(allClusterWsHostSuffixRegex, getHostHeader, false)).Subrouter()
6568
)
6669

67-
setupAcmeRouter(r)
68-
6970
r.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
7071
hostname := getHostHeader(req)
7172
log.Debugf("no match for path %s, host: %s", req.URL.Path, hostname)

0 commit comments

Comments
 (0)