-
Notifications
You must be signed in to change notification settings - Fork 116
add honeypot to snap reports #5589
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
Changes from 1 commit
6103e87
6ba1819
4310bd3
b869b51
770342b
3b5c4f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -542,6 +542,13 @@ def report_snap(): | |
|
|
||
| fields = flask.request.form | ||
|
|
||
| # If the honeypot is activated or a URL is included in the comment, | ||
|
||
| # silently reject to avoid spam | ||
| if ( | ||
| "confirm" in fields and fields["confirm"] == "on" | ||
| ) or "http" in fields.get("comment", ""): | ||
| return flask.jsonify({"ok": True}), 200 | ||
|
||
|
|
||
|
M7mdisk marked this conversation as resolved.
Outdated
|
||
| payload = { | ||
| "snap_name": fields.get("snap_name", ""), | ||
| "reason": fields.get("reason", ""), | ||
|
|
||
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.
The honeypot field lacks accessibility attributes that are important for screen reader users. While the field is intentionally hidden from visual users, it should include an aria-hidden="true" attribute to explicitly signal to assistive technologies that this field should be ignored. This ensures that screen reader users don't encounter confusion from a hidden "I agree" checkbox that appears unrelated to the form's stated purpose.
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.
@copilot open a new pull request to apply changes based on this feedback