Fix favicon 404s triggered when using loginAs() or logout() methods #1061
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.
Every Dusk test that uses
loginAs()
orlogout()
appears to record the following error intests/Browser/console
:The referrer for the 404 is
https://localhost/_dusk/login/{id}
.It happens because the controller than handles logging in and out returns void, which is presumably treated as an empty 200 response. This causes Chrome to make an additional request to
favicon.ico
. Instead these methods should return a 204 no content response, which informs Chrome it doesn't need to and stops these error logs.This bug caused me a bit of confusion, as for a while I thought my app was missing a favicon somehow when it wasn't.