You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "rnewson (via GitHub)" <gi...@apache.org> on 2023/05/09 17:08:52 UTC

[GitHub] [couchdb] rnewson opened a new pull request, #4584: Revert "fix(mango): GET invalid path under `_index` should not cause 500

rnewson opened a new pull request, #4584:
URL: https://github.com/apache/couchdb/pull/4584

   This reverts commit c1195e43c0b55f99892bb5d6b593de178499b969.
   
   This wasn't quite right. handle_index_req has several separate resources handled within it which each support a different set of http methods.
   
   We should send 405 for a resource that exists but doesn't support the request's method.
   We should send 404 for a resource that doesn't exist at all.
   
   Reverting this gives us a 500 / function_clause, which is at least honest (the server has made an error) but we should circle back and send better errors.
   
   Noting that;
   
   1) extra paths for _all_docs gives the desired 404 but for a silly reason (it matches the clause that looks for attachments, and you can't make a doc called _all_docs to attach anything to)
   2) extra paths for _changes are ignored (and the _changes request works as expected) because handle_changes_req doesn't insist on a pattern for path_parts
   
   In conclusion, we handle invalid paths in request handlers inconsistently, which ironically frees us to do the right thing in handle_index_req


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] rnewson merged pull request #4584: Revert "fix(mango): GET invalid path under `_index` should not cause 500

Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson merged PR #4584:
URL: https://github.com/apache/couchdb/pull/4584


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org