diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-28 19:15:28 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-28 19:15:28 +0100 |
commit | 50638174c89a1a953359781e7c0749aed0ef7b2d (patch) | |
tree | c67f0fe9c6723375f69c33b13990effb93d9e7b5 /app/workers/pubsubhubbub | |
parent | 4eba76711b4686ffc2faaf568e7491061ec35eb4 (diff) |
More logging to ConfirmationWorker
Diffstat (limited to 'app/workers/pubsubhubbub')
-rw-r--r-- | app/workers/pubsubhubbub/confirmation_worker.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/workers/pubsubhubbub/confirmation_worker.rb b/app/workers/pubsubhubbub/confirmation_worker.rb index 6a036adbe..24e1185d4 100644 --- a/app/workers/pubsubhubbub/confirmation_worker.rb +++ b/app/workers/pubsubhubbub/confirmation_worker.rb @@ -20,9 +20,13 @@ class Pubsubhubbub::ConfirmationWorker 'hub.lease_seconds' => subscription.lease_seconds, }) - if mode == 'subscribe' && response.body.to_s == challenge + body = response.body.to_s + + Rails.logger.debug "Confirming PuSH subscription for #{subscription.callback_url} with challenge #{challenge}: #{body}" + + if mode == 'subscribe' && body == challenge subscription.save! - elsif (mode == 'unsubscribe' && response.body.to_s == challenge) || !subscription.confirmed? + elsif (mode == 'unsubscribe' && body == challenge) || !subscription.confirmed? subscription.destroy! end end |