2.111.2: fix for redirect loops, also multisite testing fix

Apostrophe 2.111.2

This is a hotfix release to correct an infinite redirect loop that took place when attempting to access a URL that happens to match a physical folder name under /public. Since these are served by express.static, the static middleware attempted to helpfully add a trailing slash (/) to folder names where not present. Apostrophe, however, does the opposite: it redirects to remove trailing slashes in order to match page slugs.

To resolve this we now pass redirect: false to express.static when setting it up to serve the /public folder. This can still be overridden by passing the static option to apostrophe-express, but we do not recommend doing so. Apostrophe’s use of the express.static middleware is intended for static assets only.

apostrophe-multisite 2.8.1

This hotfix release corrects an issue introduced in 2.8.0. If the new “canonicalize” option is switched on for a site, any access for a different hostname such as its “pre-production” subdomain will be redirected to its final production hostname. This is good, but if the database has been “synced down” to a dev or staging environment, it makes debugging difficult. The fix is to carry out the canonical redirect only when the ENV environment variable is set to prod.

1 Like