Added logic which will (I think) prohibit links that lead to infinite loops or...
Added logic which will (I think) prohibit links that lead to infinite loops or otherwise cause urllib.request.urlopen to throw an error. Note this is a slight change from the original specs. Instead of prohibiting links which link to go at any stage of redirection (e.g. consider a go link to a bit.ly link to another go link to the final page), we prohibit links which loop infinitely (regardless of whether it's through go or not) AND links which have go at the first or last redirect stage. The urllib.request.urlopen is potentially a costly operation. In particular, if the user enters a link that times out, I think it will hang for that entire period of time. Since we now have rate limiting and have always had to manually approve users in the first place, I think the risk of this inefficiency being exploited isn't prohibitively high. Not final; I intend to fix up the comments, make the import look like it belongs there, and get feedback on how the error should be handled.
Showing with 9 additions and 1 deletion