Skip to content

Commit

Permalink
Merge pull request #14 from mvalo/patch-1
Browse files Browse the repository at this point in the history
Fix issue with TCP range ports
  • Loading branch information
José Moreira committed May 21, 2015
2 parents 67b52fa + c6e88f4 commit 92b42f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/proxy-protocol.regexp.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The maximum line lengths the receiver must support including the CRLF are :

var IPv4 = '(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))',
IPv6 = '([0-9a-fA-F]{0,4}:){2,7}(:|[0-9a-fA-F]{1,4})',
Port = '([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-2][0-9]{2}|653[0-2][0-9]|6533[0-5])'; // 1..65335
Port = '([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])'; // 1..65535


var ProxyProtocolRegexp = new RegExp(
Expand Down
2 changes: 1 addition & 1 deletion lib/proxywrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ exports.proxy = function(iface, options) {
// Check if header is valid
if (options.strict) {
if( ! ProxyProtocolRegexp.test( header ) ) {
return destroy( "PROXY protocol error" );
return destroy( "PROXY protocol error. Malformed header : " + header);
}
}

Expand Down

0 comments on commit 92b42f9

Please sign in to comment.