diff options
author | ysksn <bluewhale1982@gmail.com> | 2018-12-12 13:54:34 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-12-12 05:54:34 +0100 |
commit | 83975a2394ba6f9a6b8e6612187cb5546d4108ec (patch) | |
tree | 8f3e281a92d32861c86f9af71d966d0ccfbc033d /app/services/pubsubhubbub/subscribe_service.rb | |
parent | 351ed12b2f0314f7dd6c31ef018d84ca2e48ad04 (diff) |
Remove redundant (#9503)
Diffstat (limited to 'app/services/pubsubhubbub/subscribe_service.rb')
-rw-r--r-- | app/services/pubsubhubbub/subscribe_service.rb | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/app/services/pubsubhubbub/subscribe_service.rb b/app/services/pubsubhubbub/subscribe_service.rb index d2b85b85b..550da6328 100644 --- a/app/services/pubsubhubbub/subscribe_service.rb +++ b/app/services/pubsubhubbub/subscribe_service.rb @@ -19,31 +19,18 @@ class Pubsubhubbub::SubscribeService < BaseService private def process_subscribe - case subscribe_status - when :invalid_topic + if account.nil? ['Invalid topic URL', 422] - when :invalid_callback + elsif !valid_callback? ['Invalid callback URL', 422] - when :callback_not_allowed + elsif blocked_domain? ['Callback URL not allowed', 403] - when :valid + else confirm_subscription ['', 202] end end - def subscribe_status - if account.nil? - :invalid_topic - elsif !valid_callback? - :invalid_callback - elsif blocked_domain? - :callback_not_allowed - else - :valid - end - end - def confirm_subscription subscription = locate_subscription Pubsubhubbub::ConfirmationWorker.perform_async(subscription.id, 'subscribe', secret, lease_seconds) |