Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] 419 Exception with requests without referrer #139

Merged
merged 2 commits into from
May 11, 2020

Conversation

rjchauhan
Copy link
Contributor

I've figured out an issue with EnsureFrontendRequestsAreStateful middleware. If no value specified for stateful domains in .env, it is considered as blank string and middleware assumes requests is from FrontEnd and applying all following middleware, which results into 419 exception.

Steps to Reproduce Bug:

  • Set in .env SANCTUM_STATEFUL_DOMAINS= without any value
  • Make POST request without referrer to guest route registered in api.php (consider calling API from mobile App)
  • EnsureFrontendRequestsAreStateful middleware assumes request is from FrontEnd as Str::is() is matching blank string with null and returns true.

@driesvints driesvints changed the title 419 Exception with requests without referrer [2.x] 419 Exception with requests without referrer May 11, 2020
@taylorotwell taylorotwell merged commit 8efcb0b into laravel:2.x May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants