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

Wrong document returned due to incorrect URL decoding

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0.1
    • Fix Version/s: None
    • Component/s: HTTP Interface
    • Labels:
      None
    • Environment:

      Kubuntu 10.4, Firefox 3.6.8

    • Skill Level:
      Committers Level (Medium to Hard)

      Description

      I have two documents in my database: "a b" and "a+b". The first can be retrieved via "/mydb/a%20b" and the second via "/mydb/a%2Bb".

      When I enter "/mydb/a b" in the browser it automatically encodes it so the correct document is returned. But when I enter "/mydb/a+b" the URL is sent intact since "+" is a valid character in a path segment according to [1]. The problem is that "GET /mydb/a+b" makes CouchDB return the document with id "a b" and not the intended one, which is against the URI spec .

      For an informal description of URL encoding one may refer to [2].

      [1]: http://www.ietf.org/rfc/rfc2396.txt
      [2]: http://www.lunatech-research.com/archives/2009/02/03/what-every-web-developer-must-know-about-url-encoding

        Attachments

        1. logging.diff
          3 kB
          Muharem Hrnjadovic

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tarasp Taras Puchko
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: