Fix mux routing

This commit is contained in:
Neil Alexander 2022-03-28 15:32:52 +01:00
parent f5357fa8b0
commit 80780a23ab
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 4 additions and 2 deletions

View file

@ -362,13 +362,14 @@ func (m *DendriteMonolith) Start() {
httpRouter.PathPrefix(httputil.PublicMediaPathPrefix).Handler(base.PublicMediaAPIMux)
pMux := mux.NewRouter().SkipClean(true).UseEncodedPath()
pMux.PathPrefix(users.PublicURL).HandlerFunc(userProvider.FederatedUserProfiles)
pMux.PathPrefix(httputil.PublicFederationPathPrefix).Handler(base.PublicFederationAPIMux)
pMux.PathPrefix(httputil.PublicMediaPathPrefix).Handler(base.PublicMediaAPIMux)
pHTTP := m.PineconeQUIC.HTTP()
pHTTP.Mux().Handle(users.PublicURL, pMux)
pHTTP.Mux().Handle(httputil.PublicFederationPathPrefix, pMux)
pHTTP.Mux().Handle(httputil.PublicMediaPathPrefix, pMux)
pHTTP.Mux().HandleFunc(users.PublicURL, userProvider.FederatedUserProfiles)
// Build both ends of a HTTP multiplex.
h2s := &http2.Server{}

View file

@ -255,13 +255,14 @@ func main() {
embed.Embed(httpRouter, *instancePort, "Pinecone Demo")
pMux := mux.NewRouter().SkipClean(true).UseEncodedPath()
pMux.PathPrefix(users.PublicURL).HandlerFunc(userProvider.FederatedUserProfiles)
pMux.PathPrefix(httputil.PublicFederationPathPrefix).Handler(base.PublicFederationAPIMux)
pMux.PathPrefix(httputil.PublicMediaPathPrefix).Handler(base.PublicMediaAPIMux)
pHTTP := pQUIC.HTTP()
pHTTP.Mux().Handle(users.PublicURL, pMux)
pHTTP.Mux().Handle(httputil.PublicFederationPathPrefix, pMux)
pHTTP.Mux().Handle(httputil.PublicMediaPathPrefix, pMux)
pHTTP.Mux().HandleFunc(users.PublicURL, userProvider.FederatedUserProfiles)
// Build both ends of a HTTP multiplex.
httpServer := &http.Server{