Pylons/pyramid — pull request #838 by bertjwregeer (2013-02-02 03:15:47+00:00)
Title: Improvement/allow url without scheme

Issue #798 laid out an example where it would be beneficial to be able to specify a URL to a static_view without using a scheme in the URL. This would allow the browser to pick between https/http itself.

This pull request attempts to fix that and add support for that feature. I do believe that more tests need to be added to verify that this doesn't break anything else, but all older tests in Pyramid run without issues.

The other thing is that I had considered dropping checking for the `scheme` entirely and just looking to see if a `netloc` is defined, but decided to make that an or statement just in case I missed a case where the `scheme` is defined but `urlparse` doesn't return a `netloc` (correct me if I am wrong, but I don't think that is even possible. In which case the change would simple be `0` => `1` to make it work).

This also adds a test for `StaticURLInfo`, and a test for `static_url`.

I've signed the `CONTRIBUTORS.txt`[[1][1]] file in a previous pull request, let me know if you'd like me to cherry-pick that into this pull request as well.

[1]: https://github.com/Pylons/pyramid/pull/837