Procházet zdrojové kódy

Since GNU Social hubs don't seem to return a hub.lease_seconds param in the subscription confirmation request,

we'll have to default that value to the GS "minimum" (from their code) which is 24 hours.
master
Eugen Rochko před 7 roky
rodič
revize
1d2856c2af
1 změnil soubory, kde provedl 1 přidání a 2 odebrání
  1. +1
    -2
      app/controllers/api/subscriptions_controller.rb

+ 1
- 2
app/controllers/api/subscriptions_controller.rb Zobrazit soubor

@@ -4,8 +4,7 @@ class Api::SubscriptionsController < ApiController

def show
if @account.subscription(api_subscription_url(@account.id)).valid?(params['hub.topic'])
Rails.logger.debug "PuSH confirmation: #{params.inspect}"
@account.update(subscription_expires_at: Time.now + (params['hub.lease_seconds'].to_i).seconds)
@account.update(subscription_expires_at: Time.now + ((params['hub.lease_seconds'] || 86400).to_i).seconds)
render plain: HTMLEntities.new.encode(params['hub.challenge']), status: 200
else
head 404


Načítá se…
Zrušit
Uložit