From 4c0195e0340220e53fe5c44299eff53f2f0e210c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 28 Oct 2013 13:44:41 +0100 Subject: http: remove MethodToString() The list of supported HTTP methods is available in JS land now so there is no longer any need to pass a stringified version of the method to the parser callback, it can look up the method name for itself. Saves a call to v8::Eternal::Get() in the common case and a costly v8::String::NewFromOneByte() in the uncommon case. --- lib/_http_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/_http_common.js b/lib/_http_common.js index 3bc1346cc3..2fb5bd818d 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -92,7 +92,7 @@ function parserOnHeadersComplete(info) { if (info.method) { // server only - parser.incoming.method = info.method; + parser.incoming.method = HTTPParser.methods[info.method]; } else { // client only parser.incoming.statusCode = info.statusCode; -- cgit v1.2.1