tonydewan/Carabiner — pull request #2 by nrutman (2012-12-12 20:10:40+00:00)
Title: Better URL Detection

We noticed that Carabiner did not support [protocol-relative URLs](http://paulirish.com/2010/the-protocol-relative-url/) nor FTP URLs, both of which could easily be used within a web application to serve JavaScript or CSS files. The current version tries to write protocol-relative and FTP URLs as relative URLs, which obviously is not the desired intent.

This pull request updates the regular expression that detects a valid URL so it returns `true` for both protocol-relative as well as FTP URLs.

The `_get_contents()` function now prepends `http:` if a protocol-relative URL is found so that the standard HTTP protocol is used when getting the contents of protocol-relative URLs.