Skip to content

Commit 76ba232

Browse files
committed
Make TwitterMixin.twitter_request accept complete urls, not just partial paths.
Closes tornadoweb#418.
1 parent cadfb90 commit 76ba232

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tornado/auth.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,13 @@ def _on_post(self, new_entry):
499499
self.finish("Posted a message!")
500500
501501
"""
502+
if path.startswith('http:') or path.startswith('https:'):
503+
# Raw urls are useful for e.g. search which doesn't follow the
504+
# usual pattern: http://search.twitter.com/search.json
505+
url = path
506+
else:
507+
url = "http://api.twitter.com/1" + path + ".json"
502508
# Add the OAuth resource request signature if we have credentials
503-
url = "http://api.twitter.com/1" + path + ".json"
504509
if access_token:
505510
all_args = {}
506511
all_args.update(args)

0 commit comments

Comments
 (0)