From: Ben Darnell Date: Mon, 27 May 2013 19:19:04 +0000 (-0400) Subject: Add an overridable attribute FacebookGraphMixin._FACEBOOK_BASE_URL. X-Git-Tag: v3.1.0~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e5d58b0cd65f5cd4f0f9f0fb40cfce05cb0b9a5;p=thirdparty%2Ftornado.git Add an overridable attribute FacebookGraphMixin._FACEBOOK_BASE_URL. Closes #241. --- diff --git a/docs/releases/next.rst b/docs/releases/next.rst index 597b10779..424fbb988 100644 --- a/docs/releases/next.rst +++ b/docs/releases/next.rst @@ -18,8 +18,11 @@ Multiple modules `tornado.auth` ~~~~~~~~~~~~~~ -* `tornado.auth.OAuthMixin` always sends ``oauth_version=1.0`` in its +* `~tornado.auth.OAuthMixin` always sends ``oauth_version=1.0`` in its request as required by the spec. +* `~tornado.auth.FacebookGraphMixin` now uses ``self._FACEBOOK_BASE_URL`` + in `~.FacebookGraphMixin.facebook_request` to allow the base url to be + overridden. `tornado.escape` ~~~~~~~~~~~~~~~~ diff --git a/tornado/auth.py b/tornado/auth.py index ded1821b9..f1856b1e8 100644 --- a/tornado/auth.py +++ b/tornado/auth.py @@ -1095,6 +1095,7 @@ class FacebookGraphMixin(OAuth2Mixin): _OAUTH_ACCESS_TOKEN_URL = "https://graph.facebook.com/oauth/access_token?" _OAUTH_AUTHORIZE_URL = "https://graph.facebook.com/oauth/authorize?" _OAUTH_NO_CALLBACKS = False + _FACEBOOK_BASE_URL = "https://graph.facebook.com" @_auth_return_future def get_authenticated_user(self, redirect_uri, client_id, client_secret, @@ -1205,7 +1206,7 @@ class FacebookGraphMixin(OAuth2Mixin): return self.finish("Posted a message!") """ - url = "https://graph.facebook.com" + path + url = self._FACEBOOK_BASE_URL + path all_args = {} if access_token: all_args["access_token"] = access_token