Skip to content
Snippets Groups Projects
Commit 2ba6537f authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Escape PuSH challenge and change subscriptions and salmon APIs to text/plain

parent 68931c1e
No related branches found
No related tags found
No related merge requests found
class Api::SalmonController < ApiController
before_action :set_account
respond_to :txt
def update
ProcessInteractionService.new.(request.body.read, @account)
......
class Api::SubscriptionsController < ApiController
before_action :set_account
respond_to :txt
def show
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
render nothing: true, status: 404
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment