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

Virtualhost drops querystring parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.11
    • 0.11
    • HTTP Interface
    • OSX Snow Leopard 10.6.2, CouchDB 0.11.0b15d10793-git

    Description

      When making GET requests with querystring parameters (http://foo/bar?querystring), the query string seems to get dropped in the request is to a host with a matching vhost entry.

      I have the following vhost setup in local.ini:
      swift-ca2.swiftshift.local:5984 = /swift-ca

      I've tested my view without vhosts by requesting http://localhost:5984/swift-ca/_design/swift/_view/schedules?include_docs=true and it works fine (docs are included in the json, as expected). The following is the debug log when that request is made:

      [debug] [<0.213.0>] 'GET' /swift-ca/_design/swift/_view/schedules?include_docs=true

      {1,1}
      Headers: [{'Connection',"close"},
      {'Host',"localhost:5984"},
      {'User-Agent',"HTTP%20Client/0.9.1 CFNetwork/454.5 Darwin/10.2.0 (i386) (MacBookPro5%2C1)"}]
      [debug] [<0.213.0>] OAuth Params: [{"include_docs","true"}]
      [debug] [<0.213.0>] request_group {Pid, Seq} {<0.221.0>,214}
      [info] [<0.213.0>] 127.0.0.1 - - 'GET' /swift-ca/_design/swift/_view/schedules?include_docs=true 200
      [debug] [<0.213.0>] Include Doc: <<"ac2a8cdf84a6ad8257bb366c2800410b">> nil
      [debug] [<0.213.0>] Include Doc: <<"ac2a8cdf84a6ad8257bb366c28004747">> nil
      [debug] [<0.213.0>] Include Doc: <<"ac2a8cdf84a6ad8257bb366c280052e3">> nil
      [debug] [<0.213.0>] Include Doc: <<"ac2a8cdf84a6ad8257bb366c28005fac">> nil
      [debug] [<0.213.0>] Include Doc: <<"ac2a8cdf84a6ad8257bb366c2800608c">> nil

      If I, instead, request via the vhost at http://swift-ca2.swiftshift.local:5984/_design/swift/_view/schedules?include_docs=true, the docs are not included in the resulting json, and the debug log shows the following:

      [debug] [<0.94.0>] Vhost Target: '"/swift-ca/_design/swift/_view/schedules"'
      [debug] [<0.94.0>] 'GET' /swift-ca/_design/swift/_view/schedules {1,1}

      Headers: [

      {'Connection',"close"}

      ,

      {'Host',"swift-ca2.swiftshift.local:5984"}

      ,

      {'User-Agent',"HTTP%20Client/0.9.1 CFNetwork/454.5 Darwin/10.2.0 (i386) (MacBookPro5%2C1)"}

      ]
      [debug] [<0.94.0>] OAuth Params: []
      [debug] [<0.91.0>] Spawning new group server for view group _design/swift in database swift-ca.
      [debug] [<0.94.0>] request_group

      {Pid, Seq}

      {<0.221.0>,214}

      [info] [<0.94.0>] 127.0.0.1 - - 'GET' /swift-ca/_design/swift/_view/schedules 200
      [debug] [<0.81.0>] New task status for swift-ca _design/swift: Finishing.

      Note that in the second line the querystring is omitted.

      Attachments

        1. couchdb-678-trunk.patch
          2 kB
          Filipe David Borba Manana

        Activity

          People

            Unassigned Unassigned
            dgoodlad David Goodlad
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: