From 3a0fec07018845b12ef23f324abe16d5856b5671 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 22 Nov 2016 19:52:01 -0300 Subject: [PATCH] standard fixes --- lib/client/http-tracker.js | 2 +- lib/common-node.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/client/http-tracker.js b/lib/client/http-tracker.js index 8b767e2..bf675a6 100644 --- a/lib/client/http-tracker.js +++ b/lib/client/http-tracker.js @@ -10,7 +10,7 @@ var inherits = require('inherits') var common = require('../common') var Tracker = require('./tracker') -var HTTP_SCRAPE_SUPPORT = /\/(announce)[^\/]*$/ +var HTTP_SCRAPE_SUPPORT = /\/(announce)[^/]*$/ inherits(HTTPTracker, Tracker) diff --git a/lib/common-node.js b/lib/common-node.js index dbc3565..5cc1c0f 100644 --- a/lib/common-node.js +++ b/lib/common-node.js @@ -6,7 +6,7 @@ var Buffer = require('safe-buffer').Buffer var querystring = require('querystring') -exports.IPV4_RE = /^[\d\.]+$/ +exports.IPV4_RE = /^[\d.]+$/ exports.IPV6_RE = /^[\da-fA-F:]+$/ exports.REMOVE_IPV4_MAPPED_IPV6_RE = /^::ffff:/ @@ -57,7 +57,7 @@ exports.querystringStringify = function (obj) { var saved = querystring.escape querystring.escape = escape // global var ret = querystring.stringify(obj) - ret = ret.replace(/[@\*\/\+]/g, function (char) { + ret = ret.replace(/[@*/+]/g, function (char) { // `escape` doesn't encode the characters @*/+ so we do it manually return '%' + char.charCodeAt(0).toString(16).toUpperCase() })