mediapop / django-friendface

Getting Facebook to work for Django.
2 stars 0 forks source link

What would be the implications of turning a facebook POST into a GET in a middleware? #43

Open kitsunde opened 11 years ago

kitsunde commented 11 years ago

If say you put it as the last middleware.

yarbelk commented 11 years ago

This kind of makes me twitch. It would be better to do it in the view, class based views would be good for this - we make one that changes the dispatch and then use that for facebook views. but then this would be hard to understand if we secretly swap gets and posts.

This doesn't sound like a problem with an easy solution...

kitsunde commented 11 years ago

We are already doing it in the class based views, the problem is that we would need to override every single generic view to handle facebook requests. Which is a bit silly as the facebook request is really a GET in disguise since it's not doing a destructive operation.

I'm more worried if there's things in Django that will break if we change the verb mid request while having POST data.

yarbelk commented 11 years ago

Lots of the generic vies test post and get... So I'm also not sure. On 23 Jan 2013 12:54, "Kit Sunde" notifications@github.com wrote:

We are already doing it in the class based views, the problem is that we would need to override every single generic view to handle facebook requests. Which is a bit silly as the facebook request is really a GET in disguise since it's not doing a destructive operation.

I'm more worried if there's things in Django that will break if we change the verb mid request while having POST data.

— Reply to this email directly or view it on GitHubhttps://github.com/mediapop/django-friendface/issues/43#issuecomment-12581593.

kitsunde commented 11 years ago

Ah but this would be when a decoded signed_request is pressent. Regular POST would work the same.

kitsunde commented 11 years ago

Oh actually that's a good point, I could try to run djangos tests with the middleware in place.

gaqzi commented 11 years ago

I like this idea. Because it'll make Facebook behave like a normal web page. So it'll make it easier to get going with doing Facebook.

I definitely think it's worth testing at least!