http: make DELETE requests set req.method

Fixes #6461.
This commit is contained in:
Nathan Rajlich 2013-11-04 09:39:29 -08:00
parent 962686b67b
commit 9bc53d887a
2 changed files with 4 additions and 3 deletions

View File

@ -27,6 +27,7 @@ var IncomingMessage = incoming.IncomingMessage;
var readStart = incoming.readStart; var readStart = incoming.readStart;
var readStop = incoming.readStop; var readStop = incoming.readStop;
var isNumber = require('util').isNumber;
var debug = require('util').debuglog('http'); var debug = require('util').debuglog('http');
exports.debug = debug; exports.debug = debug;
@ -90,7 +91,7 @@ function parserOnHeadersComplete(info) {
parser.incoming._addHeaderLines(headers, n); parser.incoming._addHeaderLines(headers, n);
if (info.method) { if (isNumber(info.method)) {
// server only // server only
parser.incoming.method = HTTPParser.methods[info.method]; parser.incoming.method = HTTPParser.methods[info.method];
} else { } else {

View File

@ -24,9 +24,9 @@ var assert = require('assert');
var net = require('net'); var net = require('net');
var http = require('http'); var http = require('http');
// Test that the PATCH and PURGE verbs get passed through correctly // Test that the DELETE, PATCH and PURGE verbs get passed through correctly
['PATCH', 'PURGE'].forEach(function(method, index) { ['DELETE', 'PATCH', 'PURGE'].forEach(function(method, index) {
var port = common.PORT + index; var port = common.PORT + index;
var server_response = ''; var server_response = '';