It`s support methods "PUT" and "DELETE" when it comes to submitting forms.

This commit is contained in:
nothing2lose
2013-05-31 22:17:35 +09:00
parent 3fda05e4ef
commit 580a8e2d48

View File

@@ -26,6 +26,10 @@ exports.setup = function(req, res, next) {
if(~req.url.indexOf('?')) {
try {
req.query = parseQuery(req.url);
m = req.query['_method']
if ( m ) {
req.method = m.toUpperCase()
}
} catch (ex) {
res.setHeader('Content-Type', 'text/plain');
res.statusCode = 400;
@@ -130,4 +134,4 @@ exports.redirect = function(res, url, statusCode) {
var autoParse = {
'application/x-www-form-urlencoded': parseBody,
'application/json': parseBody
};
};