Details
-
Bug
-
Resolution: Fixed
-
Minor
-
3.0.3
-
Security Level: Public
-
CBG Sprint 104, CBG Sprint 105, CBG Sprint 106
-
3
Description
HTTP 1.1 specifies that Etag values are delimited by double-quotes; this affects headers Etag, If-Match, If-None-Match, etc. Sync Gateway isn't doing this in some cases.
- The admin API for accessing the config (admin_api.go) both sets and reads unquoted etags.
- doc_api.go appears to set quoted Etag: headers, but when it reads If-Match: headers it doesn't unquote them. As far as I can tell, this breaks conditional GETs of documents. I don't think that feature is being tested properly
- api_test.go isn't detecting the above bug – it expects the quotes when it looks at document Etags, but when it generates If-Match headers for requests it doesn't quote them. In other words it isn't acting like a real client and sending back the same Etag it received.