Skip to content

Commit

Permalink
Merge pull request #136 from jcmuller/fix-regex-catastrophic-backtrac…
Browse files Browse the repository at this point in the history
…king-fix

Replace regex without catastrophic backtracking
  • Loading branch information
mpalmer authored Oct 1, 2017
2 parents 624bf9b + 32d8a02 commit 5cbbfb8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/rack/contrib/jsonp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ module Rack
class JSONP
include Rack::Utils

VALID_JS_VAR = /[a-zA-Z_$][\w$]*/
VALID_CALLBACK = /\A#{VALID_JS_VAR}(?:\.?#{VALID_JS_VAR})*\z/
VALID_CALLBACK = /\A[a-zA-Z_$](?:\.?[\w$])*\z/

# These hold the Unicode characters \u2028 and \u2029.
#
Expand Down

0 comments on commit 5cbbfb8

Please sign in to comment.