forked from treehouse/mastodon
Escape PuSH challenge and change subscriptions and salmon APIs to text/plain
parent
68931c1ee8
commit
2ba6537f52
|
@ -1,5 +1,6 @@
|
||||||
class Api::SalmonController < ApiController
|
class Api::SalmonController < ApiController
|
||||||
before_action :set_account
|
before_action :set_account
|
||||||
|
respond_to :txt
|
||||||
|
|
||||||
def update
|
def update
|
||||||
ProcessInteractionService.new.(request.body.read, @account)
|
ProcessInteractionService.new.(request.body.read, @account)
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
class Api::SubscriptionsController < ApiController
|
class Api::SubscriptionsController < ApiController
|
||||||
before_action :set_account
|
before_action :set_account
|
||||||
|
respond_to :txt
|
||||||
|
|
||||||
def show
|
def show
|
||||||
if @account.subscription(api_subscription_url(@account.id)).valid?(params['hub.topic'], params['hub.verify_token'])
|
if @account.subscription(api_subscription_url(@account.id)).valid?(params['hub.topic'], params['hub.verify_token'])
|
||||||
render text: params['hub.challenge'], status: 200
|
render text: HTMLEntities.new.encode(params['hub.challenge']), status: 200
|
||||||
else
|
else
|
||||||
render nothing: true, status: 404
|
render nothing: true, status: 404
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue