Disable GET method for flagging/unflagging

Created on 21 April 2020, almost 5 years ago
Updated 19 February 2025, about 2 months ago

I'm having trouble where I'm spidering content and it keeps flagging and unflagging my content because it's following the flag links.

I would like to use an AJAX flag that doesn't involve a page reload; but the AJAX link and Normal link types place a link with href= that modifies the favorite status on a GET request.

I flagged this as a bug because it's not expected behavior, here's the relevant section from HTTP (4.2.1. Safe Methods):

For example, it is common for Web-based content editing software to use actions within query parameters, such as "page?do=delete". If the purpose of such a resource is to perform an unsafe action, then the resource owner MUST disable or disallow that action when it is accessed using a safe request method. Failure to do so will result in unfortunate side effects when automated processes perform a GET on every URI reference for the sake of link maintenance, pre-fetching, building a search index, etc.

The expected behavior is if I follow the link with a GET request; it does not modify the flag status; but shows a button to re-request with POST.

An associated feature request that would largely fix this would be Add Checkboxes as Display Type ✨ Add Checkboxes as Display Type Closed: outdated ; especially if the flag is updated with an AJAX POST or PUT request.

πŸ› Bug report
Status

Closed: outdated

Component

Flag core

Created by

πŸ‡ΊπŸ‡ΈUnited States Acubed

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024