guyaloni
guyaloni

Reputation: 5912

Detect ngrok from Rails

I am using ngrok in order to test my Rails application integration with PayPal.

Since my application works with subdomains, I would like to detect when call is made from ngrok so I can apply a different behaviour.

Is there any way to configure ngrok to pass some information so I can detect the call comes from there? Or any other way to know that ngrok stands behind the call?

Upvotes: 0

Views: 418

Answers (1)

oreoluwa
oreoluwa

Reputation: 5633

Within your controller, you could check the request.host, which would have something related to ngrok somewhere there.

Or look at this older SO question which uses a route constraint.

Upvotes: 1

Related Questions