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
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
The "new" --render argument for artisan down command does it's job well, by rendering whatever template has been requested. Sadly, when using this option it appears that API requests (requests that have Accept: application/json header set) are not handled correctly.
The framework usually deals with this automatically, when not using the --render option. But, when running composer install / update in the background, some requests might actually lead to an "Internal Server Error", because parts of the framework / vendor has yet to be installed by composer. So, the new pre-rendering of view makes a lot of sense. But it would be really nice if pre-rendering / maintenance mode could somehow take API requests into account.
Possible Solution A
The generated storage/framework/maintenance.php could check for Accept: application/json headers (or variants hereof) and ensure NOT to output html, if such is the case.
Possible Solution B
Add a --resolve-via argument to the artisan down that accepts a php file path. This file could then be used instead of the maintenance.php file, allowing developer to resolve maintenance mode however they wish.
Note: this does differ from the --render in that pre-rendered blade templates or php files do not have access to the http headers of the current request (at least not according to my knowledge / experiments).
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The "new"
--render
argument forartisan down
command does it's job well, by rendering whatever template has been requested. Sadly, when using this option it appears that API requests (requests that haveAccept: application/json
header set) are not handled correctly.The framework usually deals with this automatically, when not using the
--render
option. But, when running composer install / update in the background, some requests might actually lead to an "Internal Server Error", because parts of the framework / vendor has yet to be installed by composer. So, the new pre-rendering of view makes a lot of sense. But it would be really nice if pre-rendering / maintenance mode could somehow take API requests into account.Possible Solution A
The generated
storage/framework/maintenance.php
could check forAccept: application/json
headers (or variants hereof) and ensure NOT to output html, if such is the case.Possible Solution B
Add a
--resolve-via
argument to theartisan down
that accepts a php file path. This file could then be used instead of themaintenance.php
file, allowing developer to resolve maintenance mode however they wish.Note: this does differ from the
--render
in that pre-rendered blade templates or php files do not have access to the http headers of the current request (at least not according to my knowledge / experiments).The text was updated successfully, but these errors were encountered: