]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add an overridable attribute FacebookGraphMixin._FACEBOOK_BASE_URL.
authorBen Darnell <ben@bendarnell.com>
Mon, 27 May 2013 19:19:04 +0000 (15:19 -0400)
committerBen Darnell <ben@bendarnell.com>
Mon, 27 May 2013 19:19:04 +0000 (15:19 -0400)
Closes #241.

docs/releases/next.rst
tornado/auth.py

index 597b1077930437d8d67d5c7241b96a8f9c9fb89c..424fbb988ed1227cf6516eea63e1c82a69b59a94 100644 (file)
@@ -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`
 ~~~~~~~~~~~~~~~~
index ded1821b93b806a2c7607f50b2b6ddb5dbbf2c1f..f1856b1e8587a51bd441c08083f3ecc98c20098a 100644 (file)
@@ -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