Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.
This repository was 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

@ghost

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions