You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Dale Harvey (JIRA)" <ji...@apache.org> on 2012/05/30 09:23:23 UTC

[jira] [Created] (COUCHDB-1487) If-None-Match isnt invalidated by Accept type

Dale Harvey created COUCHDB-1487:
------------------------------------

             Summary: If-None-Match isnt invalidated by Accept type
                 Key: COUCHDB-1487
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1487
             Project: CouchDB
          Issue Type: Bug
          Components: HTTP Interface
            Reporter: Dale Harvey


If-None-Match is not invalidated by the Accept header which may vary the contents of the returned data (making the data cached by the client invalid)

// If-None-Match returns empty body regardless of Accept
$ curl -X GET "http://localhost:1234/test_suite_db1/bin_doc2?attachments=true" -H 'Accept: application/json' -H 'If-None-Match: "2-14688d4a246bd2a4cc390d998a9c5230"'
~/src/pouchdb (master)

$ curl -X GET "http://localhost:1234/test_suite_db1/bin_doc2?attachments=true" -H 'If-None-Match: "2-14688d4a246bd2a4cc390d998a9c5230"'~/src/pouchdb (master)

// Content differs base on Accept
$ curl -X GET "http://localhost:1234/test_suite_db1/bin_doc2?attachments=true" -H 'Accept: application/json'{"_id":"bin_doc2","_rev":"2-14688d4a246bd2a4cc390d998a9c5230","_attachments":{"foo2.txt":{"content_type":"text/plain; charset=UTF-8","revpos":2,"digest":"md5-oWU+DkMWYcPGKs/F0Lic5A==","data":"VGhpcyBpcyBubyBiYXNlNjQgZW5jb2RlZCB0ZXh0"},"foo.txt":{"content_type":"text/plain","revpos":1,"digest":"md5-cCkGbCesb17xjWYNV0GXmg==","data":""}}}
~/src/pouchdb (master)

$ curl -X GET "http://localhost:1234/test_suite_db1/bin_doc2?attachments=true" --8b098c9b630fa64a56ba8341b89186e0
content-type: application/json

{"_id":"bin_doc2","_rev":"2-14688d4a246bd2a4cc390d998a9c5230","_attachments":{"foo2.txt":{"content_type":"text/plain; charset=UTF-8","revpos":2,"digest":"md5-oWU+DkMWYcPGKs/F0Lic5A==","length":30,"follows":true,"encoding":"gzip","encoded_length":48},"foo.txt":{"content_type":"text/plain","revpos":1,"digest":"md5-cCkGbCesb17xjWYNV0GXmg==","length":0,"follows":true,"encoding":"gzip","encoded_length":20}}}
--8b098c9b630fa64a56ba8341b89186e0

?
??,V??|????T3?Լ?????Ԋ??=
--8b098c9b630fa64a56ba8341b89186e0

?
--8b098c9b630fa64a56ba8341b89186e0--

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (COUCHDB-1487) If-None-Match isnt invalidated by Accept type

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

Robert Newson commented on COUCHDB-1487:
----------------------------------------

Probably missing a "Vary: Accept" response header in general here. Will confirm with spec.
                
> If-None-Match isnt invalidated by Accept type
> ---------------------------------------------
>
>                 Key: COUCHDB-1487
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1487
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>            Reporter: Dale Harvey
>
> If-None-Match is not invalidated by the Accept header which may vary the contents of the returned data (making the data cached by the client invalid)
> // If-None-Match returns empty body regardless of Accept
> $ curl -X GET "http://localhost:1234/test_suite_db1/bin_doc2?attachments=true" -H 'Accept: application/json' -H 'If-None-Match: "2-14688d4a246bd2a4cc390d998a9c5230"'
> ~/src/pouchdb (master)
> $ curl -X GET "http://localhost:1234/test_suite_db1/bin_doc2?attachments=true" -H 'If-None-Match: "2-14688d4a246bd2a4cc390d998a9c5230"'~/src/pouchdb (master)
> // Content differs base on Accept
> $ curl -X GET "http://localhost:1234/test_suite_db1/bin_doc2?attachments=true" -H 'Accept: application/json'{"_id":"bin_doc2","_rev":"2-14688d4a246bd2a4cc390d998a9c5230","_attachments":{"foo2.txt":{"content_type":"text/plain; charset=UTF-8","revpos":2,"digest":"md5-oWU+DkMWYcPGKs/F0Lic5A==","data":"VGhpcyBpcyBubyBiYXNlNjQgZW5jb2RlZCB0ZXh0"},"foo.txt":{"content_type":"text/plain","revpos":1,"digest":"md5-cCkGbCesb17xjWYNV0GXmg==","data":""}}}
> ~/src/pouchdb (master)
> $ curl -X GET "http://localhost:1234/test_suite_db1/bin_doc2?attachments=true" --8b098c9b630fa64a56ba8341b89186e0
> content-type: application/json
> {"_id":"bin_doc2","_rev":"2-14688d4a246bd2a4cc390d998a9c5230","_attachments":{"foo2.txt":{"content_type":"text/plain; charset=UTF-8","revpos":2,"digest":"md5-oWU+DkMWYcPGKs/F0Lic5A==","length":30,"follows":true,"encoding":"gzip","encoded_length":48},"foo.txt":{"content_type":"text/plain","revpos":1,"digest":"md5-cCkGbCesb17xjWYNV0GXmg==","length":0,"follows":true,"encoding":"gzip","encoded_length":20}}}
> --8b098c9b630fa64a56ba8341b89186e0
> ?
> ??,V??|????T3?Լ?????Ԋ??=
> --8b098c9b630fa64a56ba8341b89186e0
> ?
> --8b098c9b630fa64a56ba8341b89186e0--

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira