Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Application install fails when CouchDB is accessed through a proxy that applies gzip compression #77

Open
ghost opened this issue Mar 12, 2014 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 12, 2014

Hi Ryan,

We recently switched our frontend nginx configuration over to use gzip compression on the application/json MIME type, provided the client browser supports it. When this setting is on, the Etag sent from from CouchDB is stripped by nginx, due to the fact that the Etag header is supposed to match the HTTP response body byte-for-byte (regardless of encoding or compression).

If the Etag isn't present, Garden's installer triggers an exception in the function:

deleteDoc(couch_db, db_name, doc_id, callback)

at the following line:

var rev = jqXHR.getResponseHeader('ETag').replace(/"/gi, '');

I realize we're using HEAD here to fetch the rev via the Etag header because the design document may be large. Is there any other way we can possibly fetch the rev value that'd be safe even when the Etag is stripped or absent? Our current workaround is just to disable gzip compression for all application/json-typed documents (which we could probably limit to beneath /dashboard, but ideally we'd be able to have it turned on everywhere).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants