You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by willholley <gi...@git.apache.org> on 2015/01/31 11:53:56 UTC

[GitHub] couchdb-chttpd pull request: Enable POST requests to /_changes in ...

GitHub user willholley opened a pull request:

    https://github.com/apache/couchdb-chttpd/pull/22

    Enable POST requests to /_changes in clustered CouchDB

    Appropriate handling of a POST to _changes is already in place in single node CouchDB. In clustered CouchDB, allow POST requests to pass through to the underlying handler and existing logic will do the rest.
    
    COUCHDB-2530

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/willholley/couchdb-chttpd 2530-changes-does-not-support-post

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-chttpd/pull/22.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #22
    
----
commit 8f94e87671d9a57ab845d7536540b97b5e5e2b60
Author: Will Holley <wi...@gmail.com>
Date:   2015-01-31T10:46:30Z

    Enable POST requests to /_changes in clustered CouchDB
    
    Appropriate handling of a POST to _changes is already in place in
    single node CouchDB. In clustered CouchDB, allow POST requests to pass
    through to the underlying handler and existing logic will do the rest.
    
    COUCHDB-2530

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-chttpd pull request: Enable POST requests to /_changes in ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/couchdb-chttpd/pull/22


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-chttpd pull request: Enable POST requests to /_changes in ...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb-chttpd/pull/22#issuecomment-72317668
  
    Cool, LGFM.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-chttpd pull request: Enable POST requests to /_changes in ...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-chttpd/pull/22#discussion_r23888643
  
    --- Diff: src/chttpd_db.erl ---
    @@ -61,7 +61,7 @@ handle_request(#httpd{path_parts=[DbName|RestParts],method=Method,
             do_db_req(Req, Handler)
         end.
     
    -handle_changes_req(#httpd{method='GET'}=Req, Db) ->
    +handle_changes_req1(#httpd{}=Req, Db) ->
    --- End diff --
    
    `handle_changes_req1` should comes after `handle_changes_req` functions. You should be able to read the code from top to bottom, not in reverse.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-chttpd pull request: Enable POST requests to /_changes in ...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-chttpd/pull/22#discussion_r23888645
  
    --- Diff: src/chttpd_db.erl ---
    @@ -87,7 +87,13 @@ handle_changes_req(#httpd{method='GET'}=Req, Db) ->
         _ ->
             Msg = <<"Supported `feed` types: normal, continuous, longpoll, eventsource">>,
             throw({bad_request, Msg})
    -    end;
    +    end.
    +
    +handle_changes_req(#httpd{method='POST'}=Req, Db) ->
    +    couch_httpd:validate_ctype(Req, "application/json"),
    +    handle_changes_req1(Req, Db);
    +handle_changes_req(#httpd{method='GET'}=Req, Db) ->
    +    handle_changes_req1(Req, Db);
     handle_changes_req(#httpd{path_parts=[_,<<"_changes">>]}=Req, _Db) ->
         send_method_not_allowed(Req, "GET,HEAD").
    --- End diff --
    
    You forgot to define `POST` as allowed method here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-chttpd pull request: Enable POST requests to /_changes in ...

Posted by willholley <gi...@git.apache.org>.
Github user willholley commented on the pull request:

    https://github.com/apache/couchdb-chttpd/pull/22#issuecomment-72316917
  
    @kxepal thanks - addressed both points in the latest push


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-chttpd pull request: Enable POST requests to /_changes in ...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb-chttpd/pull/22#issuecomment-72336263
  
    Landed, thank you! (:


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---