visionmedia/express — Issue #860: Html entity within data in http request corrupts data
Author: ladariha
Created: 2011-10-09 16:38:51+00:00
State: open

If I send request that contains html entity, then the data are corrupted and the sended string is only partial, everything after the entity is lost.

Express configuration:
app.use(express.methodOverride())
app.use(express.bodyParser());

JS in html page:

var params = "slide=scalability &ndash";
request.open("PUT", url, true);
request.setRequestHeader("Content-type", "application/x-www-form-
urlencoded");
request.setRequestHeader("Content-length", params.length);
request.setRequestHeader("Connection", "close");
request.onreadystatechange = function(){
if (request.readyState==4) {...
}else{ ... }
};
request.send(params);

And the on server side in app.put:

var content=request.body.slide;
// content = scalability
// but it should be content= scalability &ndash