Sha256: a6f1c6a46c955d4d50ee825d8304c3d426b016c61dc8763b5a4066d002408e7f

Contents?: true

Size: 513 Bytes

Versions: 1

Compression:

Stored size: 513 Bytes

Contents

module IndieWeb
  module Endpoints
    module Services
      class ResponseHeadersParserService
        def self.parse(response, identifier)
          headers = LinkHeaderParser.parse(response.headers.get('link'), base: response.uri.to_s).by_relation_type[identifier]

          return unless headers

          # Reject endpoints that contain a fragment identifier
          headers.reject { |header| Addressable::URI.parse(header.target_uri).fragment }.map(&:target_uri)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
indieweb-endpoints-3.0.0 lib/indieweb/endpoints/services/response_headers_parser_service.rb