You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…d in a slash to prevent 404's and/or errors accessing the web interfaces
The default paths for the web interfaces, such as /admin/, /account/, /webmail/
and /webapi/ end with a slash. They should end with a slash because we use the
path when restricting cookies to just that web interface. You could configure
paths not ending with a slash, but due to using http.StripPrefix, and our
handler, some of those requests may not work properly.
We now warn if configured paths don't end with a trailing slash when parsing
the config file. We normally error out when such things happen, but users
probably have paths without trailing slashes configured, and we don't want to
break them on a future upgrade. We now use an effective path that includes the
trailing slash.
We would always redirect requests to the configured paths but without trailing
slash to the path with trailing slash, and that stays.
For issue #325 by odama626.
Thanks for reporting @odama626! The paths should have an effective path ending in a slash, if only for proper cookiepath handling. I've changed the config parser to ensure the effective paths registered always end with a slash. We were already redirecting requests for paths without trailing slash to paths with trailing slash. The commit message has a few more details. If you want to test this now works as intended, you could compile or download mox with this commit, and run "mox localserve" and change the mox.conf to check the behaviour is now less error-prone.
I just noticed an oddity that took me a bit to figure out, it's just a nitpick though, this is a fantastic project.
AccountHTTPS:
Path: /account
returns a 404
AccountHTTPS:
Path: /account/
returns page
WebmailHTTPS:
Path: /webmail
and
Path: /webmail/
both returns page
the difference is, I noticed that AccountHTTPS paths without the trailing / don't work, but they do for webmail
The text was updated successfully, but these errors were encountered: