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.
The path
GET /resource/unlock?unlock_token=TOKEN
is not currentlyidempotent, which brings some problems when the page is hit by an
antivirus, prefetch, or anything other than the user. For example,
Microsoft SafeLinks technology visits URLs sent in emails to make sure
that the URL doesn't have malware.
This change keeps, when configured, the unlock token after the resource
has been unlocked. If the user happens to click on the unlock link after
it has already been visited, it will behave as if this was the first
visit, even though the resource is technically unlocked since the first
visit. This makes the GET request idempotent and doesn't break the
current behavior.
This may add a side effect on database queries that check how many
resources have
unlock_token
not null to count how many resources areunlocked. To address this side effect, the new behavior is turned off by
default.
The first version of the Lockable module logged the user in, but this
is not true since #1493 was merged. When a resource is locked again,
another unlock token is created and overwrites the older one. Keeping
the most recent unlock token, then, doesn't represent a security issue.