Permalink
Browse files

from_url now follows HTTP redirects

  • Loading branch information...
1 parent d1a5399 commit 24a61fbf8f132f18ab023048fcb7aeed4a1591be @valueof valueof committed Jan 3, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 feedreader/parser.py
View
@@ -67,5 +67,8 @@ def from_url(url, **kwargs):
raise ParseError('Bad status line: %s' % (exc,))
if response.status != 200:
+ if response.status in (301, 302):
+ return from_url(response.getheader('location'), **kwargs)
raise ParseError('%s %s' % (response.status, response.reason))
+
return from_file(response, base_url=base_url)

0 comments on commit 24a61fb

Please sign in to comment.