CouchDB
  1. CouchDB
  2. COUCHDB-1017

HTTP Rewrite Handler: Rewriting strings in queries

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.0.1
    • Fix Version/s: None
    • Component/s: HTTP Interface
    • Labels:
      None
    • Skill Level:
      Regular Contributors Level (Easy to Medium)

      Description

      I have this rewrite:
      {
      "from": "/u/:key",
      "to": "_list/pouch/user-items",
      "method": "GET",
      "query":

      {"key": ":key"}

      }
      ..where the view returns:

      {"error":"bad_request","reason":"invalid UTF-8 JSON"}

      . The view query looks like this ?key=somekey, but for the view to succeed "somekey" need to be in double quotes.

      Maybe one could improve the rewriter's behavior for rewriting strings in queries?

      Here is one workaround:
      {
      "from": "/u/:startkey",
      "to": "_list/pouch/user-items",
      "method": "GET",
      "query": {
      "startkey": [":startkey"],
      "endkey": [":startkey", {}]
      }
      },

        Activity

          People

          • Assignee:
            Benoit Chesneau
            Reporter:
            Michel Legnered
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development