about summary refs log tree commit diff
diff options
context:
space:
mode:
authorabcang <abcang1015@gmail.com>2017-09-28 22:04:32 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-28 15:04:32 +0200
commit3d9b8847d21d886886baae483304288139669795 (patch)
tree28338bf793ebc525f1e44ace50a7f46424aaf123
parentb9f59ebcc68e9da0a7158741a1a2ef3564e1321e (diff)
Flush body when POST requests (#5128)
-rw-r--r--app/services/send_interaction_service.rb2
-rw-r--r--app/services/subscribe_service.rb2
-rw-r--r--app/services/unsubscribe_service.rb2
-rw-r--r--app/workers/activitypub/delivery_worker.rb2
-rw-r--r--app/workers/pubsubhubbub/delivery_worker.rb2
5 files changed, 5 insertions, 5 deletions
diff --git a/app/services/send_interaction_service.rb b/app/services/send_interaction_service.rb
index c11813abc..af205c9c9 100644
--- a/app/services/send_interaction_service.rb
+++ b/app/services/send_interaction_service.rb
@@ -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
diff --git a/app/services/subscribe_service.rb b/app/services/subscribe_service.rb
index bfa7ff8c8..2d8af0203 100644
--- a/app/services/subscribe_service.rb
+++ b/app/services/subscribe_service.rb
@@ -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.
diff --git a/app/services/unsubscribe_service.rb b/app/services/unsubscribe_service.rb
index b99046712..d84a5a530 100644
--- a/app/services/unsubscribe_service.rb
+++ b/app/services/unsubscribe_service.rb
@@ -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
diff --git a/app/workers/activitypub/delivery_worker.rb b/app/workers/activitypub/delivery_worker.rb
index a4e829343..059c32813 100644
--- a/app/workers/activitypub/delivery_worker.rb
+++ b/app/workers/activitypub/delivery_worker.rb
@@ -28,7 +28,7 @@ class ActivityPub::DeliveryWorker
   end
 
   def perform_request
-    @response = build_request.perform
+    @response = build_request.perform.flush
   end
 
   def response_successful?
diff --git a/app/workers/pubsubhubbub/delivery_worker.rb b/app/workers/pubsubhubbub/delivery_worker.rb
index 110b8bf16..c3506727b 100644
--- a/app/workers/pubsubhubbub/delivery_worker.rb
+++ b/app/workers/pubsubhubbub/delivery_worker.rb
@@ -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?