mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-12 19:59:03 +08:00
It`s support methods "PUT" and "DELETE" when it comes to submitting forms.
This commit is contained in:
@@ -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
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user