You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Filippo (JIRA)" <ji...@apache.org> on 2010/11/12 05:25:13 UTC

[jira] Created: (COUCHDB-947) /_restart API requires "Content-Type: application/json"

/_restart API requires "Content-Type: application/json"
-------------------------------------------------------

                 Key: COUCHDB-947
                 URL: https://issues.apache.org/jira/browse/COUCHDB-947
             Project: CouchDB
          Issue Type: Bug
          Components: Database Core
    Affects Versions: 1.0.1
         Environment: Mac OS X 10.6.5
            Reporter: Filippo


The "/_restart" API requires "Content-Type: application/json" header. This is not coherent because the API doesn't need parameters to be passed using JSON.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-947) /_restart API requires "Content-Type: application/json"

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932586#action_12932586 ] 

Benoit Chesneau commented on COUCHDB-947:
-----------------------------------------

I tested if this condition could be overriden using enctype attribute in a form, but it couldn't at least in ff or chrome (dunno for ie) so it make sense to keep it. I think it has been applied to others already.

> /_restart API requires "Content-Type: application/json"
> -------------------------------------------------------
>
>                 Key: COUCHDB-947
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-947
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.1, 1.2
>         Environment: Mac OS X 10.6.5
>            Reporter: Filippo Fadda
>             Fix For: 1.0.1, 1.1, 1.2
>
>
> The "/_restart" API requires "Content-Type: application/json" header. This is not coherent because the API doesn't need parameters to be passed using JSON.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-947) /_restart API requires "Content-Type: application/json"

Posted by "Filippo Fadda (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932532#action_12932532 ] 

Filippo Fadda commented on COUCHDB-947:
---------------------------------------

Good point Jan, I agree. Maybe we should use same approch for the many APIs that actually are using POST method. For example "/_replicate", "/_compact", "/_view_cleanup", etc.: all of them are time consuming processes that we can secure in some way. I think all those functions must use the trick of "Content-Type: application/json", or better, I suggest to use a well defined and documented custom header.
I can make a list of all those "special" functions.

> /_restart API requires "Content-Type: application/json"
> -------------------------------------------------------
>
>                 Key: COUCHDB-947
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-947
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.1, 1.2
>         Environment: Mac OS X 10.6.5
>            Reporter: Filippo Fadda
>             Fix For: 1.0.1, 1.1, 1.2
>
>
> The "/_restart" API requires "Content-Type: application/json" header. This is not coherent because the API doesn't need parameters to be passed using JSON.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (COUCHDB-947) /_restart API requires "Content-Type: application/json"

Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Lehnardt closed COUCHDB-947.
--------------------------------

    Resolution: Not A Problem

> /_restart API requires "Content-Type: application/json"
> -------------------------------------------------------
>
>                 Key: COUCHDB-947
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-947
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.1, 1.2
>         Environment: Mac OS X 10.6.5
>            Reporter: Filippo Fadda
>             Fix For: 1.1, 1.2, 1.0.1
>
>
> The "/_restart" API requires "Content-Type: application/json" header. This is not coherent because the API doesn't need parameters to be passed using JSON.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-947) /_restart API requires "Content-Type: application/json"

Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932180#action_12932180 ] 

Jan Lehnardt commented on COUCHDB-947:
--------------------------------------

I think it is safe to remove the requirement to pass in the Content-Type, since no data is actually stored.

> /_restart API requires "Content-Type: application/json"
> -------------------------------------------------------
>
>                 Key: COUCHDB-947
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-947
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.1, 1.2
>         Environment: Mac OS X 10.6.5
>            Reporter: Filippo Fadda
>             Fix For: 1.0.1, 1.1, 1.2
>
>
> The "/_restart" API requires "Content-Type: application/json" header. This is not coherent because the API doesn't need parameters to be passed using JSON.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-947) /_restart API requires "Content-Type: application/json"

Posted by "Filippo Fadda (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filippo Fadda updated COUCHDB-947:
----------------------------------

    Fix Version/s: 1.2

> /_restart API requires "Content-Type: application/json"
> -------------------------------------------------------
>
>                 Key: COUCHDB-947
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-947
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.0.1
>         Environment: Mac OS X 10.6.5
>            Reporter: Filippo Fadda
>             Fix For: 1.2
>
>
> The "/_restart" API requires "Content-Type: application/json" header. This is not coherent because the API doesn't need parameters to be passed using JSON.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-947) /_restart API requires "Content-Type: application/json"

Posted by "Filippo Fadda (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filippo Fadda updated COUCHDB-947:
----------------------------------

        Fix Version/s: 1.0.1
                       1.1
    Affects Version/s:     (was: 1.0.1)
                       1.2
                       1.1

> /_restart API requires "Content-Type: application/json"
> -------------------------------------------------------
>
>                 Key: COUCHDB-947
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-947
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.1, 1.2
>         Environment: Mac OS X 10.6.5
>            Reporter: Filippo Fadda
>             Fix For: 1.0.1, 1.1, 1.2
>
>
> The "/_restart" API requires "Content-Type: application/json" header. This is not coherent because the API doesn't need parameters to be passed using JSON.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-947) /_restart API requires "Content-Type: application/json"

Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12932204#action_12932204 ] 

Jan Lehnardt commented on COUCHDB-947:
--------------------------------------

I take my previous statement back and pronounce the opposite.

The reason is any website could restart your local CouchDB (or any CouchDB under a well known URL) by sending a form submit to that URL. By requiring the Content-Type to be application/json, we ensure an HTML form can't do this.

It's inconvenient, but required. Sorry.

> /_restart API requires "Content-Type: application/json"
> -------------------------------------------------------
>
>                 Key: COUCHDB-947
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-947
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 1.1, 1.2
>         Environment: Mac OS X 10.6.5
>            Reporter: Filippo Fadda
>             Fix For: 1.0.1, 1.1, 1.2
>
>
> The "/_restart" API requires "Content-Type: application/json" header. This is not coherent because the API doesn't need parameters to be passed using JSON.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.