From 01a7284a8f3928739c410eebd969715a9cccc791 Mon Sep 17 00:00:00 2001 From: Mohammed ALDOUB Date: Sat, 14 Apr 2012 05:53:51 +0300 Subject: [PATCH] I have added the following lines to the function 'request' starting in line 287: # convert any http Twitter url into https, for the sake of user security # only convert the protocol part, not all occurences of http://, in case users want to search that endpoint = endpoint.replace('http://','https://',1) This is to ensure all passed Twitter urls are converted into https, without messing with the rest of the url. --- twython/twython.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/twython/twython.py b/twython/twython.py index 2f7f787..978856e 100644 --- a/twython/twython.py +++ b/twython/twython.py @@ -289,6 +289,9 @@ class Twython(object): # In case they want to pass a full Twitter URL # i.e. http://search.twitter.com/ + # convert any http Twitter url into https, for the sake of user security + # only convert the protocol part, not all occurences of http://, in case users want to search that + endpoint = endpoint.replace('http://','https://',1) if endpoint.startswith('http://'): url = endpoint else: