CouchDB
  1. CouchDB
  2. COUCHDB-1242

Filtered replication silently converts all query parameters to strings

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.2, 1.1
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      Description

      All filtered query params are silently converted to strings. this causes tests for if (req.query.foo) to evaluate to true even for {"query_params":{"foo":false}} because "false" is true.

      No clean solution exists to fix this as _changes has a GET entry point and request parameters are untyped.

      Suggested fix is to scan the query_params in handle_replicate_req and throw a 400 Bad Request if any value is not a JSON string.

        Activity

        Hide
        Robert Newson added a comment -

        Passing non-strings will give a useful 400 Bad Request message rather than silently do the wrong thing.

        Show
        Robert Newson added a comment - Passing non-strings will give a useful 400 Bad Request message rather than silently do the wrong thing.
        Hide
        Robert Newson added a comment -

        For trunk this also needs to update the validate_doc_update fun for _replicator

        Show
        Robert Newson added a comment - For trunk this also needs to update the validate_doc_update fun for _replicator
        Hide
        Robert Newson added a comment -

        Patch for 1.0.x

        (should be similar for 1.1.x and completely wrong for trunk)

        Show
        Robert Newson added a comment - Patch for 1.0.x (should be similar for 1.1.x and completely wrong for trunk)

          People

          • Assignee:
            Robert Newson
            Reporter:
            Robert Newson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development