-
Notifications
You must be signed in to change notification settings - Fork 429
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
fix: Remove CSRF parameter from sales-dashboard search form #3716
fix: Remove CSRF parameter from sales-dashboard search form #3716
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@rolodato is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Uffizzi Preview |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3716 +/- ##
=======================================
Coverage 95.89% 95.89%
=======================================
Files 1101 1101
Lines 34681 34681
=======================================
Hits 33256 33256
Misses 1425 1425 ☔ View full report in Codecov by Sentry. |
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
The search form in the Sales dashboard includes a CSRF token. This token is not validated (it can be omitted with no consequence) and it is not necessary (this is a read-only GET endpoint, so it can be safely removed).
The main benefit of removing the CSRF token is it allows us to share nicer URLs to pre-made queries, such as
/sales-dashboard/?search=foo
. Otherwise, the search URLs look like/sales-dashboard/?csrfmiddlewaretoken=obnoxiously_long_random_string_that_appears_before_the_actual_search_term&search=foo
.How did you test this code?
Manually in development only. I've confirmed that this endpoint in production also does not validate the presence of the
csrfmiddleware
parameter.