mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-08 14:43:09 -06:00
Set CORS headers for the 404s
This commit is contained in:
parent
645f31ae24
commit
d4e1d1aca7
|
|
@ -451,6 +451,10 @@ func (b *BaseDendrite) SetupAndServeHTTP(
|
|||
externalRouter.PathPrefix(httputil.PublicMediaPathPrefix).Handler(b.PublicMediaAPIMux)
|
||||
externalRouter.PathPrefix(httputil.PublicWellKnownPrefix).Handler(b.PublicWellKnownAPIMux)
|
||||
|
||||
notFoundHandler := httputil.WrapHandlerInCORS(http.NotFoundHandler())
|
||||
internalRouter.NotFoundHandler = notFoundHandler
|
||||
externalRouter.NotFoundHandler = notFoundHandler
|
||||
|
||||
if internalAddr != NoListener && internalAddr != externalAddr {
|
||||
go func() {
|
||||
var internalShutdown atomic.Bool // RegisterOnShutdown can be called more than once
|
||||
|
|
|
|||
Loading…
Reference in a new issue