Adam Elsodaney
Adam Elsodaney

Reputation: 7808

Silex/Symfony app working, but not in Facebook

I have a Silex + Twig app running just fine on Heroku when not iframed, but when iframed in Facebook, it throws an exception.

MethodNotAllowedHttpException: No route found for "POST /": Method Not Allowed (Allow: GET)

Is there any particular way that Silex should handle any requests through Facebook?

Upvotes: 4

Views: 1197

Answers (1)

Maerlyn
Maerlyn

Reputation: 34107

If your app is loaded inside facebook (in an iframe), the very first request is POST, not GET. Your route is defined as get-only. Change it to ->method() (or even ->post(), but I recommend method), and it'll work.

Upvotes: 5

Related Questions