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
3737 Addressable ::URI ::CharacterClasses ::DIGIT + '_'
3838
3939 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])+)"
4141 RESERVED =
4242 "(?:[#{ anything } ]|%[a-fA-F0-9][a-fA-F0-9])"
4343 UNRESERVED =
Original file line number Diff line number Diff line change 1919require "spec_helper"
2020
2121require "bigdecimal"
22+ require "timeout"
2223require "addressable/template"
2324
2425shared_examples_for 'expands' do |tests |
@@ -1340,6 +1341,14 @@ def self.match(name)
13401341 expect ( subject ) . not_to match ( "foo_bar*" )
13411342 expect ( subject ) . not_to match ( "foo_bar:20" )
13421343 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
13431352 end
13441353 context "VARIABLE_LIST" do
13451354 subject { Addressable ::Template ::VARIABLE_LIST }
You can’t perform that action at this time.
0 commit comments