NEW Allow silverstripe/errorpage to static publish #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using the error page module to create custom content error pages within the CMS (for e.g. HTTP 404 & 500) the default is to also static publish these files so the web server can reference them directly. This requires an unauthenticated execution of the controller in a mocked request in order to get all the page HTML without revealing any user based customised data that may be present. SAMLMiddleware will currently redirect this request to the IdP for authentication when enabled, essentially preventing error pages from being published, ever (in the default configuration).
Hooks to customise the environment before dispatching the mocked request to the error page controller have recently been added to the ErrorPage, allowing us to disable the middleware & re-set it after the mock request completes. We can apply this via config only if the module exists.
Resolves #32