Skip to content

Commit 50d3d6a

Browse files
committed
Rewrite request tracking code and http module integration
1 parent 9f78415 commit 50d3d6a

File tree

4 files changed

+396
-462
lines changed

4 files changed

+396
-462
lines changed

index.js

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
/**
22
* Copyright (c) 2016 Fabio Massaioli and other contributors
33
*
4-
* Code from Node http module:
5-
* Copyright Joyent, Inc. and other Node contributors
6-
*
74
* Permission is hereby granted, free of charge, to any person obtaining a copy of
85
* this software and associated documentation files (the "Software"), to deal in
96
* the Software without restriction, including without limitation the rights to
@@ -24,18 +21,18 @@
2421

2522
'use strict';
2623

27-
var server = require('./lib/server.js');
28-
var response = require('./lib/response.js');
24+
var http = require('http');
25+
26+
var server = require('./lib/server.js'),
27+
response = require('./lib/response.js');
2928

3029
exports.Server = server.Server;
31-
exports.Request = require('./lib/request.js').Request;
32-
exports.Response = response.Response;
33-
exports.AuthorizerResponse = response.AuthorizerResponse;
34-
exports.FilterResponse = response.FilterResponse;
3530

3631
// NOTE: http module compatibility
37-
exports.IncomingMessage = exports.Request;
38-
exports.ServerResponse = exports.Response;
32+
exports.IncomingMessage = http.IncomingMessage;
33+
exports.OutgoingMessage = http.OutgoingMessage;
34+
exports.ServerResponse = response.ServerResponse;
35+
exports.AuthorizerResponse = response.AuthorizerResponse;
3936

4037
/**
4138
* function createServer([responder], [authorizer], [filter], [config])
@@ -51,12 +48,3 @@ exports.ServerResponse = exports.Response;
5148
exports.createServer = function (responder, authorizer, filter, config) {
5249
return new server.Server(responder, authorizer, filter, config);
5350
};
54-
55-
exports.patchHttp = function () {
56-
var http = require('http');
57-
for (key in exports) {
58-
if (key in http) {
59-
http[key] = exports[key];
60-
}
61-
}
62-
};

0 commit comments

Comments
 (0)