Skip to content

fix(api): fix HTTP 405 Method Not Allowed when deleting card attachme… - #8683

Open
aquananu wants to merge 1 commit into
nextcloud:mainfrom
aquananu:fix/routes-delete-attachment-405
Open

aquananu wants to merge 1 commit into
nextcloud:mainfrom
aquananu:fix/routes-delete-attachment-405

Conversation

@aquananu

@aquananu aquananu commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

…nts via OCS API

In appinfo/routes.php, attachment_ocs#update was registered before attachment_ocs#delete without regex restrictions on {attachmentId}. Because {attachmentId} defaults to [^/]+, it greedily matched {type}:{attachmentId} (such as 'file:92921') and rejected DELETE requests with HTTP 405 Method Not Allowed before attachment_ocs#delete could be evaluated.

This moves attachment_ocs#delete before update and adds strict regex requirements for {type} and {attachmentId}.

  • Resolves: #
  • Target version: main

Summary

TODO

  • ...

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

…nts via OCS API

In appinfo/routes.php, attachment_ocs#update was registered before
attachment_ocs#delete without regex restrictions on {attachmentId}.
Because {attachmentId} defaults to [^/]+, it greedily matched
{type}:{attachmentId} (such as 'file:92921') and rejected DELETE
requests with HTTP 405 Method Not Allowed before attachment_ocs#delete
could be evaluated.

This moves attachment_ocs#delete before update and adds strict regex
requirements for {type} and {attachmentId}.

Signed-off-by: aquananu <AQUANANU@GMAIL.COM>
@blizzz

blizzz commented Nov 6, 2026

Copy link
Copy Markdown
Member

Possibly related to #8146?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants