Skip to content
Snippets Groups Projects
Commit 3d9b8847 authored by abcang's avatar abcang Committed by Eugen Rochko
Browse files

Flush body when POST requests (#5128)

parent b9f59ebc
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ class SendInteractionService < BaseService
return if !target_account.ostatus? || block_notification?
delivery = build_request.perform
delivery = build_request.perform.flush
raise Mastodon::UnexpectedResponseError, delivery unless delivery.code > 199 && delivery.code < 300
end
......
......@@ -6,7 +6,7 @@ class SubscribeService < BaseService
@account = account
@account.secret = SecureRandom.hex
@response = build_request.perform
@response = build_request.perform.flush
if response_failed_permanently?
# We're not allowed to subscribe. Fail and move on.
......
......@@ -7,7 +7,7 @@ class UnsubscribeService < BaseService
@account = account
begin
@response = build_request.perform
@response = build_request.perform.flush
Rails.logger.debug "PuSH unsubscribe for #{@account.acct} failed: #{@response.status}" unless @response.status.success?
rescue HTTP::Error, OpenSSL::SSL::SSLError => e
......
......@@ -28,7 +28,7 @@ class ActivityPub::DeliveryWorker
end
def perform_request
@response = build_request.perform
@response = build_request.perform.flush
end
def response_successful?
......
......@@ -37,7 +37,7 @@ class Pubsubhubbub::DeliveryWorker
def callback_post_payload
request = Request.new(:post, subscription.callback_url, body: payload)
request.add_headers(headers)
request.perform
request.perform.flush
end
def blocked_domain?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment