Skip to content

Commit 680ad40

Browse files
committed
remove unnecessary use of regex
In addition to being faster by not re-parsing the string, this also addresses #156 Signed-off-by: Ryan Graham <[email protected]>
1 parent cba7276 commit 680ad40

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

forward.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,7 @@ function startForward(proxy_port, proxy_host) {
2626
host: host,
2727
port: port
2828
};
29-
30-
var urlmatch = req.url.match(/http:\/\/[^/]*:?[0-9]*(\/.*)$/);
31-
32-
if(urlmatch) {
33-
req.url = urlmatch[1];
34-
} else {
35-
req.url = '/';
36-
}
29+
req.url = _url.path;
3730

3831
} else {
3932
target = {

0 commit comments

Comments
 (0)