Skip to content

Commit 5cbbfb8

Browse files
authored
Merge pull request #136 from jcmuller/fix-regex-catastrophic-backtracking-fix
Replace regex without catastrophic backtracking
2 parents 624bf9b + 32d8a02 commit 5cbbfb8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/rack/contrib/jsonp.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ module Rack
77
class JSONP
88
include Rack::Utils
99

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

1312
# These hold the Unicode characters \u2028 and \u2029.
1413
#

0 commit comments

Comments
 (0)