cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daserge <...@git.apache.org>
Subject [GitHub] cordova-labs pull request: CB-9563 Mulptipart form data is used ev...
Date Tue, 24 Nov 2015 20:38:59 GMT
Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-labs/pull/9#discussion_r45791347
  
    --- Diff: server.js ---
    @@ -35,15 +37,34 @@ http.createServer(function (req, res) {
             res.writeHead(200, {'Content-Type': 'text/plain'});
             res.end("Hello!\n");
         } else if (req.url == '/upload' && (req.method.toLowerCase() == 'post' ||
req.method.toLowerCase() == 'put')) {
    -        var form = new formidable.IncomingForm();
    -        form.parse(req, function(err, fields, files) {
    -            res.writeHead(200, {'content-type': 'text/plain'});
    -            console.log(stringify({fields: fields, files: files}));
    +        if(req.headers["content-type"].indexOf("multipart/form-data") === 0) {
    +            console.log("multipart/form upload");
    +            var form = new formidable.IncomingForm();
    +            form.parse(req, function(err, fields, files) {
    +                res.writeHead(200, {'content-type': 'text/plain'});
    +                console.log(stringify({fields: fields, files: files}));
    +
    +                res.write(stringify({fields: fields, files: files}));
    +                console.log
    --- End diff --
    
    Thanks, I will remove it. It was there before though, but it makes no sense.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message