projects
/
rss2maildir.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea9637d
)
* Add https support (thanks to Andre Klärner)
author
Brett Parker
<iDunno@sommitrealweird.co.uk>
Sat, 23 Jul 2011 12:06:47 +0000
(13:06 +0100)
committer
Brett Parker
<iDunno@sommitrealweird.co.uk>
Sat, 23 Jul 2011 12:06:47 +0000
(13:06 +0100)
rss2maildir.py
patch
|
blob
|
history
diff --git
a/rss2maildir.py
b/rss2maildir.py
index a1e8819f8fcb067eff4cb892c70a460bc6b294c7..b4acdec086d924bb9175c51dca551caf9ab07913 100755
(executable)
--- a/
rss2maildir.py
+++ b/
rss2maildir.py
@@
-612,10
+612,17
@@
def open_url(method, url):
(type, rest) = urllib.splittype(url)
(host, path) = urllib.splithost(rest)
(host, port) = urllib.splitport(host)
(type, rest) = urllib.splittype(url)
(host, path) = urllib.splithost(rest)
(host, port) = urllib.splitport(host)
- if port == None:
+ if type == "https":
+ if port == None:
+ port = 443
+ elif port == None:
port = 80
try:
port = 80
try:
- conn = httplib.HTTPConnection("%s:%s" %(host, port))
+ conn = None
+ if type == "http":
+ conn = httplib.HTTPConnection("%s:%s" %(host, port))
+ else:
+ conn = httplib.HTTPSConnection("%s:%s" %(host, port))
conn.request(method, path)
response = conn.getresponse()
if response.status in [301, 302, 303, 307]:
conn.request(method, path)
response = conn.getresponse()
if response.status in [301, 302, 303, 307]: