Skip to content
Browse files

Expose versionMajor versionMinor to http messages

  • Loading branch information...
1 parent 4f679fd commit 7538e707677b29b276a543a4e1db9d4c3893c0c6 @ry ry committed
Showing with 6 additions and 0 deletions.
  1. +2 −0 lib/http.js
  2. +4 −0 src/node_http.cc
View
2 lib/http.js
@@ -407,6 +407,8 @@ function createIncomingMessageStream (connection, incoming_listener) {
}
incoming.httpVersion = info.httpVersion;
+ incoming.httpVersionMajor = info.versionMajor;
+ incoming.httpVersionMinor = info.versionMinor;
if (info.method) {
// server only
View
4 src/node_http.cc
@@ -245,6 +245,10 @@ HTTPConnection::on_headers_complete (http_parser *parser)
, connection->parser_.http_minor
);
message_info->Set(HTTP_VERSION_SYMBOL, String::New(version));
+ message_info->Set(String::NewSymbol("versionMajor"),
+ Integer::New(connection->parser_.http_major));
+ message_info->Set(String::NewSymbol("versionMinor"),
+ Integer::New(connection->parser_.http_minor));
message_info->Set(SHOULD_KEEP_ALIVE_SYMBOL,
http_should_keep_alive(&connection->parser_) ? True() : False());

0 comments on commit 7538e70

Please sign in to comment.
Something went wrong with that request. Please try again.