couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Shorin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1705) Update Function does not parse multipart/form-data
Date Sat, 11 Oct 2014 14:29:34 GMT

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

Alexander Shorin commented on COUCHDB-1705:
-------------------------------------------

Only [application/x-www-form-urlencoded | https://github.com/apache/couchdb/blob/1.6.x/src/couchdb/couch_httpd_external.erl#L70]
get parsed into `req.form` object. It's not an easy to transform multipart request into the
plain JavaScript object since it's complex and recursive format with many nested levels of
data and commonly headers of each part matters as like as payload data. Would considered it
not a bug, but feature request.

> Update Function does not parse multipart/form-data
> --------------------------------------------------
>
>                 Key: COUCHDB-1705
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1705
>             Project: CouchDB
>          Issue Type: Bug
>          Components: JavaScript View Server
>    Affects Versions: 1.2.1, 1.6.1
>            Reporter: Anthony Ananich
>
> I have a design doc and update handler.
> {quote}
> function(doc, req) {
>     log(req);
>     var newdoc = {};
>     ...
>     return [newdoc, \{
>     	code: 200,
>     	body: req.uuid
>         }];
> }
> {quote}
> I made a HTML file with the following form
> {quote}
> <form action="http://localhost:5984/db/_design/app/_update/crashreport" method="POST"
enctype="multipart/form-data">
> <input type="text" name="classname"/><br>
> <input type="Submit">
> </form>
> {quote}
> In the log file I can see that POST request body exists, but was not parsed:
> {quote}
> { "body" : "------WebKitFormBoundaryE6xRBni3g8MNw14P\r\nContent-Disposition: form-data;
name=\"classname\"\r\n\r\nABC\r\n------WebKitFormBoundaryE6xRBni3g8MNw14P--\r\n",
>   "form" : {  },
> ...
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message