Skip to content

Commit

Permalink
Block long a-z chars sequences as well as numbers.
Browse files Browse the repository at this point in the history
Signed-off-by: Arnout Kazemier <[email protected]>
  • Loading branch information
mcollina authored and 3rd-Eden committed Mar 21, 2017
1 parent 50be8cb commit b18cf7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ function isSafe(userAgent) {

for (var i = 0; i < userAgent.length; i++) {
code = userAgent.charCodeAt(i);
// numbers between 0 and 9
if (code >= 48 && code <= 57) {
// numbers between 0 and 9, letters between a and z
if ((code >= 48 && code <= 57) || (code >= 97 && code <= 122)) {
consecutive++;
} else {
consecutive = 0;
Expand Down

0 comments on commit b18cf7c

Please sign in to comment.