You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by mayya-sharipova <gi...@git.apache.org> on 2015/09/02 22:18:16 UTC

[GitHub] couchdb-couch-mrview pull request: check POST requests for valid j...

GitHub user mayya-sharipova opened a pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/25

    check POST requests for valid json header

    validate that all POST requests with json body must have also have valid
    json header: {"Content-Type": "application/json"}
    This ensures a basic protection against CSRF
    
    JIRA: COUCHDB-2775

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

    $ git pull https://github.com/cloudant/couchdb-couch-mrview 2775-post-valid-json-header

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

    https://github.com/apache/couchdb-couch-mrview/pull/25.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 #25
    
----
commit ee597df4006a2c9a7ca7c7cd984a9d9b6af6cc42
Author: Mayya Sharipova <ma...@ca.ibm.com>
Date:   2015-09-02T20:14:51Z

    check POST requests for valid json header
    
    validate that all POST requests with json body must have also have valid
    json header: {"Content-Type": "application/json"}
    This ensures a basic protection against CSRF
    
    JIRA: COUCHDB-2775

----


---
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-couch-mrview pull request: check POST requests for valid j...

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

    https://github.com/apache/couchdb-couch-mrview/pull/25


---
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-couch-mrview pull request: check POST requests for valid j...

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

    https://github.com/apache/couchdb-couch-mrview/pull/25#issuecomment-148963074
  
    +1


---
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-couch-mrview pull request: check POST requests for valid j...

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

    https://github.com/apache/couchdb-couch-mrview/pull/25#discussion_r38580404
  
    --- Diff: src/couch_mrview_http.erl ---
    @@ -136,7 +141,7 @@ handle_view_req(Req, _Db, _DDoc) ->
     
     
     handle_temp_view_req(#httpd{method='POST'}=Req, Db) ->
    -    couch_httpd:validate_ctype(Req, "application/json"),
    +    chttpd:validate_ctype(Req, "application/json"),
    --- End diff --
    
    Here you first check content type and the if user is admin, while below,  handle_compact_req and handle_cleanup_req does that in reverse. Let's keep some single flow.


---
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-couch-mrview pull request: check POST requests for valid j...

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

    https://github.com/apache/couchdb-couch-mrview/pull/25#discussion_r38661157
  
    --- Diff: src/couch_mrview_http.erl ---
    @@ -136,7 +141,7 @@ handle_view_req(Req, _Db, _DDoc) ->
     
     
     handle_temp_view_req(#httpd{method='POST'}=Req, Db) ->
    -    couch_httpd:validate_ctype(Req, "application/json"),
    +    chttpd:validate_ctype(Req, "application/json"),
    --- End diff --
    
    Thanks for the comment, I have corrected this.


---
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.
---