CouchDB
  1. CouchDB
  2. COUCHDB-868

Authenticated replication fails when design documents have attachments

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.11.2, 1.0, 1.0.1
    • Fix Version/s: 1.0.3
    • Component/s: Replication
    • Labels:
      None
    • Environment:

      Linux, Erlang R13B04

      Description

      The old bug of forgetting the Authorization header still happens, apparently with documents attachments. I think the request for _design%2fddoc/attachment is bounced and the subsequent request simply follows the `Location` header without adding the credentials again.

      It looks like couch_rep_att:validate_headers/3 simply follows the "Location" header instead of doing what couch_rep_httpc's smarter `redirect_url/2`

        Activity

        Jason Smith created issue -
        Hide
        Jason Smith added a comment -

        The simplest patch (in terms of code change) is to export couch_rep_httpc's smarter function, `redirect_url` and use it in the replicator code. Attached.

        Show
        Jason Smith added a comment - The simplest patch (in terms of code change) is to export couch_rep_httpc's smarter function, `redirect_url` and use it in the replicator code. Attached.
        Jason Smith made changes -
        Field Original Value New Value
        Attachment 0001-Correctly-redirect-during-authenticated-replication.patch [ 12452821 ]
        Filipe Manana made changes -
        Assignee Filipe Manana [ fdmanana ]
        Hide
        Filipe Manana added a comment -

        Patch looks all fine.

        Will apply it later today.
        cheers

        Show
        Filipe Manana added a comment - Patch looks all fine. Will apply it later today. cheers
        Hide
        Adam Kocoloski added a comment -

        I'm a little confused. The ticket refers to docs with long revision histories, but the patch deals with attachments. Does this patch actually fix a bug with long revision histories, or just one regarding attatchments that nrstott was bumping into on IRC?

        Show
        Adam Kocoloski added a comment - I'm a little confused. The ticket refers to docs with long revision histories, but the patch deals with attachments. Does this patch actually fix a bug with long revision histories, or just one regarding attatchments that nrstott was bumping into on IRC?
        Hide
        Filipe Manana added a comment -

        Yes, definitely the title is wrong. Updating it.

        Show
        Filipe Manana added a comment - Yes, definitely the title is wrong. Updating it.
        Filipe Manana made changes -
        Summary Authenticated replication fails for docs with long revision histories Authenticated replication fails when design documents have attachments
        Hide
        Filipe Manana added a comment -

        Applied to trunk, 1.0.x and 0.11.x

        Thanks Jason

        Show
        Filipe Manana added a comment - Applied to trunk, 1.0.x and 0.11.x Thanks Jason
        Filipe Manana made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Filipe Manana made changes -
        Fix Version/s 0.11.3 [ 12315252 ]
        Affects Version/s 0.11.2 [ 12315196 ]
        Noah Slater made changes -
        Fix Version/s 1.0.3 [ 12316107 ]
        Fix Version/s 0.11.3 [ 12315252 ]

          People

          • Assignee:
            Filipe Manana
            Reporter:
            Jason Smith
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development