mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-02-01 22:47:40 +00:00
fix(routes): restore SPA routing after Echo v5 upgrade
In Echo v5, the 404 error for unmatched routes implements the
HTTPStatusCoder interface but is not a *HTTPError. This caused
the static middleware to fail to catch 404s and serve index.html
for SPA routes, leading to reloading SPA routes returning 404.
Caused by regression introduced in 9a61453e8.
Fixes #2149
Fixes #2152
This commit is contained in:
@@ -166,8 +166,8 @@ func static() echo.MiddlewareFunc {
|
||||
return err
|
||||
}
|
||||
|
||||
var he *echo.HTTPError
|
||||
if !errors.As(err, &he) || he.Code != http.StatusNotFound {
|
||||
var he echo.HTTPStatusCoder
|
||||
if !errors.As(err, &he) || he.StatusCode() != http.StatusNotFound {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user