Skip to content

Commit a4406e1

Browse files
committed
Refactor for Ruby 2.6 compatibility
1 parent 7319c2f commit a4406e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/indieweb/endpoints/response_headers_parser.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ def initialize(response)
1111
end
1212

1313
# @param identifier [Symbol]
14-
# @return [Array<String>, nil]
14+
# @return [Array<String>]
1515
def results_for(identifier)
1616
# Reject endpoints that contain a fragment identifier
17-
parsed_headers[identifier]&.filter_map do |header|
18-
header.target_uri unless HTTP::URI.parse(header.target_uri).fragment
19-
end
17+
Array(parsed_headers[identifier])
18+
.filter { |header| !HTTP::URI.parse(header.target_uri).fragment }
19+
.map(&:target_uri)
2020
end
2121

2222
private

0 commit comments

Comments
 (0)