Browse Source

fix check for whether to send namespaced params in subscription verification

master
Aaron Parecki 7 years ago
parent
commit
bc2a7e953f
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      lib/PushTask.php

+ 4
- 1
lib/PushTask.php View File

@ -14,7 +14,7 @@ class PushTask {
$exp_ts = time() + $lease_seconds;
$exp_date = date('Y-m-d H:i:s', $exp_ts);
if($feed->namespaced) {
if($subscription->namespaced) {
$prefix = 'hub.';
} else {
$prefix = '';
@ -29,6 +29,8 @@ class PushTask {
$push_params[$prefix.'lease_seconds'] = $lease_seconds;
}
echo "Verifying subscription to ".$feed->feed_url." for callback ".$subscription->callback_url."\n";
$url = parse_url($subscription->callback_url);
if($q=k($url, 'query')) {
parse_str($q, $existing_params);
@ -37,6 +39,7 @@ class PushTask {
$url['query'] = http_build_query($push_params);
$url = build_url($url);
echo "\t".$url."\n";
$response = request\get_url($url, true);
$subscription->challenge_response = $response['headers']."\n\n".$response['body'];

Loading…
Cancel
Save