We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
matches_from_headers
1 parent feb119b commit a8ec53dCopy full SHA for a8ec53d
lib/indieweb/endpoints/parser.rb
@@ -74,12 +74,15 @@ def matches_from_body(identifier, node_names)
74
body.css(selectors).map { |element| element["href"] }
75
end
76
77
+ # Reject URLs with fragment identifiers per the IndieAuth specification.
78
+ #
79
+ # @param identifier [String, #to_sym]
80
81
# @return [Array<String>]
82
def matches_from_headers(identifier)
- # Reject endpoints that contain a fragment identifier.
- Array(headers[identifier.to_sym])
- .filter { |header| !HTTP::URI.parse(header.target_uri).fragment }
- .map(&:target_uri)
83
+ Array(headers[identifier.to_sym]).filter_map do |header|
84
+ header.target_uri unless HTTP::URI.parse(header.target_uri).fragment
85
+ end
86
87
88
0 commit comments