[ 
https://issues.apache.org/jira/browse/COUCHDB-1017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12979387#action_12979387
 ] 

Michel Legnered commented on COUCHDB-1017:
------------------------------------------

Here is the full debug log for the request:

[info] [<0.32.0>] Apache CouchDB has started on http://127.0.0.1:80/
[debug] [<0.104.0>] 'GET' /inventoria/_design/inventoria/_rewrite/u/miche {1,1}
Headers: 
[{'Accept',"application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"},
          {'Accept-Charset',"ISO-8859-1,utf-8;q=0.7,*;q=0.3"},
          {'Accept-Encoding',"gzip,deflate,sdch"},
          {'Accept-Language',"en-US,en;q=0.8"},
          {'Cache-Control',"max-age=0"},
          {'Connection',"keep-alive"},
          {'Host',"127.0.0.1"},
          {'User-Agent',"Mozilla/5.0 (X11; U; Linux i686; en-US) 
AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10"}]
[debug] [<0.104.0>] OAuth Params: []
[debug] [<0.104.0>] rewrite to 
"/inventoria/_design/inventoria/_list/pouch/user-items?key=miche" 

[debug] [<0.104.0>] 'GET' 
/inventoria/_design/inventoria/_list/pouch/user-items?key=miche {1,1}
Headers: 
[{'Accept',"application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"},
          {'Accept-Charset',"ISO-8859-1,utf-8;q=0.7,*;q=0.3"},
          {'Accept-Encoding',"gzip,deflate,sdch"},
          {'Accept-Language',"en-US,en;q=0.8"},
          {'Cache-Control',"max-age=0"},
          {'Connection',"keep-alive"},
          {'Host',"127.0.0.1"},
          {'User-Agent',"Mozilla/5.0 (X11; U; Linux i686; en-US) 
AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10"}]
[debug] [<0.104.0>] OAuth Params: [{"key","miche"}]
[debug] [<0.101.0>] Spawning new group server for view group _design/inventoria 
in database inventoria.
[debug] [<0.104.0>] request_group {Pid, Seq} {<0.127.0>,233}
[error] [<0.104.0>] attempted upload of invalid JSON (set log_level to debug to 
log it)
[debug] [<0.104.0>] Invalid JSON: "miche"
[info] [<0.104.0>] 127.0.0.1 - - 'GET' 
/inventoria/_design/inventoria/_list/pouch/user-items?key=miche 400
[debug] [<0.83.0>] New task status for inventoria _design/inventoria: Finishing.
[debug] [<0.104.0>] httpd 400 error response:
 {"error":"bad_request","reason":"invalid UTF-8 JSON"}

> HTTP Rewrite Handler: Rewriting strings in queries
> --------------------------------------------------
>
>                 Key: COUCHDB-1017
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1017
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: HTTP Interface
>    Affects Versions: 1.0.1
>            Reporter: Michel Legnered
>            Assignee: Benoit Chesneau
>            Priority: Minor
>
> 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", {}]
>       }
> },

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to