diff options
author | David Yip <yipdw@member.fsf.org> | 2018-06-08 00:33:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 00:33:09 -0500 |
commit | a9515f3186b49df63436b98d382ee6a6b755387d (patch) | |
tree | d771e65a58d3c69ba1c08c3fc145f24b5b806274 /app/services | |
parent | f8d50a40701f344ea7c2a0e5475bbcbc727ef930 (diff) | |
parent | 8142bd2553e7819722fdfc401e06cb10eeddd230 (diff) |
Merge pull request #535 from glitch-soc/merge-upstream
Merge upstream
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/fetch_link_card_service.rb | 2 | ||||
-rw-r--r-- | app/services/post_status_service.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb index 86d0f9971..560a81768 100644 --- a/app/services/fetch_link_card_service.rb +++ b/app/services/fetch_link_card_service.rb @@ -40,7 +40,7 @@ class FetchLinkCardService < BaseService @card ||= PreviewCard.new(url: @url) failed = Request.new(:head, @url).perform do |res| - res.code != 405 && (res.code != 200 || res.mime_type != 'text/html') + res.code != 405 && res.code != 501 && (res.code != 200 || res.mime_type != 'text/html') end return if failed diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index b1d5bd3a7..6e982c7e6 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -28,7 +28,7 @@ class PostStatusService < BaseService status = account.statuses.create!(text: text, media_attachments: media || [], thread: in_reply_to, - sensitive: (options[:sensitive].nil? ? account.user&.setting_default_sensitive : options[:sensitive]), + sensitive: (options[:sensitive].nil? ? account.user&.setting_default_sensitive : options[:sensitive]) || options[:spoiler_text].present?, spoiler_text: options[:spoiler_text] || '', visibility: options[:visibility] || account.user&.setting_default_privacy, language: language_from_option(options[:language]) || LanguageDetector.instance.detect(text, account), |