ProgVal/Limnoria — pull request #523 by foxtacles (2013-11-19 10:07:18+00:00)
Title: rd host instead of URL host

First off, I never wrote a line of python before.

What I personally found annoying with the Web plugin snarfer was that it shows the domain of the posted URL rather than the actual host (since it follows redirects). This fixes it.

Now there's probably something about this commit which needs to be improved. I'm not catching that socket timeout exception as done in utils.web.getUrl, and that whole functionality should probably moved to utils.web anyway, but I couldn't think of a way to achieve that - the getUrl function would need to pass out 2 results (both text and geturl()), and as far as I can tell strings are immutable in Python. Two requests / new function just for geturl() wouldn't be acceptable in my opinion.

Feel free to reject this pull request if the new behaviour of the snarfer isn't acceptable, but I thought it wouldn't hurt to throw this in. If this change can be improved, please let me know :)