CouchDB
  1. CouchDB
  2. COUCHDB-1035

oauth handler always expect json encoded value for key, start_key ...

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.1, 1.2
    • Fix Version/s: None
    • Component/s: HTTP Interface
    • Labels:
      None
    • Skill Level:
      New Contributors Level (Easy)

      Description

      oauth handler always expect json encoded value for key, start_key ... even the path isn't a view, list or all_docs resources:

      Path: "/testdb/_design/legacyapp/_show/post/essai?id=essai&key=test"

      [debug] [<0.121.0>] OAuth Params: [

      {"id","essai"}

      ,

      {"key","test"}

      ]
      [error] [<0.121.0>] attempted upload of invalid JSON (set log_level to debug to log it)
      [debug] [<0.121.0>] Invalid JSON: <<"test">>

      If you are OK i will provide a patch that only try to encode when it's needed.

        Issue Links

          Activity

          Alexander Shorin made changes -
          Link This issue is duplicated by COUCHDB-1439 [ COUCHDB-1439 ]
          Hide
          Benoit Chesneau added a comment - - edited

          After looking at the code with help of filippe, the problem is not in oauth handler but in couch_httpd_external:

          https://github.com/benoitc/couchdb/blob/master/src/couchdb/couch_httpd_external.erl#L103

          So It always try to encode the key in json even if it's a show or update resource. That's a minor issue, but imo, we shouldn't do extra time to encode or require encoding if it's not needed

          Show
          Benoit Chesneau added a comment - - edited After looking at the code with help of filippe, the problem is not in oauth handler but in couch_httpd_external: https://github.com/benoitc/couchdb/blob/master/src/couchdb/couch_httpd_external.erl#L103 So It always try to encode the key in json even if it's a show or update resource. That's a minor issue, but imo, we shouldn't do extra time to encode or require encoding if it's not needed
          Benoit Chesneau made changes -
          Field Original Value New Value
          Affects Version/s 1.1 [ 12314933 ]
          Affects Version/s 1.2 [ 12315198 ]
          Priority Major [ 3 ] Minor [ 4 ]
          Component/s HTTP Interface [ 12312234 ]
          Benoit Chesneau created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Benoit Chesneau
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development