File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class Template
37
37
Addressable ::URI ::CharacterClasses ::DIGIT + '_'
38
38
39
39
var_char =
40
- "(?: (?:[#{ variable_char_class } ]|%[a-fA-F0-9][a-fA-F0-9])+)"
40
+ "(?> (?:[#{ variable_char_class } ]|%[a-fA-F0-9][a-fA-F0-9])+)"
41
41
RESERVED =
42
42
"(?:[#{ anything } ]|%[a-fA-F0-9][a-fA-F0-9])"
43
43
UNRESERVED =
Original file line number Diff line number Diff line change 19
19
require "spec_helper"
20
20
21
21
require "bigdecimal"
22
+ require "timeout"
22
23
require "addressable/template"
23
24
24
25
shared_examples_for 'expands' do |tests |
@@ -1340,6 +1341,14 @@ def self.match(name)
1340
1341
expect ( subject ) . not_to match ( "foo_bar*" )
1341
1342
expect ( subject ) . not_to match ( "foo_bar:20" )
1342
1343
end
1344
+
1345
+ it 'should parse in a reasonable time' do
1346
+ expect do
1347
+ Timeout . timeout ( 0.1 ) do
1348
+ expect ( subject ) . not_to match ( "0" *25 + "!" )
1349
+ end
1350
+ end . not_to raise_error
1351
+ end
1343
1352
end
1344
1353
context "VARIABLE_LIST" do
1345
1354
subject { Addressable ::Template ::VARIABLE_LIST }
You can’t perform that action at this time.
0 commit comments