Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1017

HTTP Rewrite Handler: Rewriting strings in queries

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 1.0.1
    • None
    • HTTP Interface
    • None
    • 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", {}]
      }
      },

      Attachments

        Activity

          People

            benoitc Benoit Chesneau
            antics Michel Legnered
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: