mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-24 13:35:07 +01:00
Fix for thread resolve service and process feed service url method
This commit is contained in:
parent
2f21f4cc01
commit
cff0b03cbb
@ -3,6 +3,11 @@ class FetchAtomService < BaseService
|
|||||||
response = http_client.head(url)
|
response = http_client.head(url)
|
||||||
|
|
||||||
Rails.logger.debug "Remote status HEAD request returned code #{response.code}"
|
Rails.logger.debug "Remote status HEAD request returned code #{response.code}"
|
||||||
|
|
||||||
|
response = http_client.get(url) if response.code == 405
|
||||||
|
|
||||||
|
Rails.logger.debug "Remote status GET request returned code #{response.code}"
|
||||||
|
|
||||||
return nil if response.code != 200
|
return nil if response.code != 200
|
||||||
|
|
||||||
if response.mime_type == 'application/atom+xml'
|
if response.mime_type == 'application/atom+xml'
|
||||||
|
@ -175,8 +175,7 @@ class ProcessFeedService < BaseService
|
|||||||
|
|
||||||
def url(xml = @xml)
|
def url(xml = @xml)
|
||||||
link = xml.at_xpath('./xmlns:link[@rel="alternate"]')
|
link = xml.at_xpath('./xmlns:link[@rel="alternate"]')
|
||||||
link['href'] unless link.nil?
|
link.nil? ? nil : link['href']
|
||||||
nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def content(xml = @xml)
|
def content(xml = @xml)
|
||||||
|
Loading…
Reference in New Issue
Block a user