Skip to content

Commit

Permalink
Merge branch 'main' of github.com:sporkmonger/addressable into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sporkmonger committed Jul 3, 2021
2 parents 56c5cf7 + e9c76b8 commit 2433638
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/addressable/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -657,12 +657,12 @@ def named_captures
def ordered_variable_defaults
@ordered_variable_defaults ||= begin
expansions, _ = parse_template_pattern(pattern)
expansions.map do |capture|
expansions.flat_map do |capture|
_, _, varlist = *capture.match(EXPRESSION)
varlist.split(',').map do |varspec|
varspec[VARSPEC, 1]
end
end.flatten
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/addressable/uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,10 @@ def self.normalize_component(component, character_class=
leave_re = if leave_encoded.length > 0
character_class = "#{character_class}%" unless character_class.include?('%')

"|%(?!#{leave_encoded.chars.map do |char|
"|%(?!#{leave_encoded.chars.flat_map do |char|
seq = SEQUENCE_ENCODING_TABLE[char]
[seq.upcase, seq.downcase]
end.flatten.join('|')})"
end.join('|')})"
end

character_class = if leave_re
Expand Down

0 comments on commit 2433638

Please sign in to comment.