kennethreitz/requests — pull request #984 by deontologician (2012-12-03 00:06:27+00:00)
Title: Improved conformance of link header parsing. Added unit tests as well

In [RFC-5988](http://tools.ietf.org/html/rfc5988) link headers are allowed to specify multiple rels per link by separating them with a space

Link: ;rel="rel1 rel2"

In addition, there can be multiple links with the same rel, which the current .links() implementation doesn't allow since it overwrites earlier links with later ones.

This patch adds both of those capabilities, and in addition changes the "url" tag to the "href" tag in order to align better with the RFCs terminology (because the link header derives from the link html tag, which uses href).

Several of the regex's used are modified version of those from the mnot/redbot project.

I added unit tests in the patch, but there are also some basic end to end tests [here](https://gist.github.com/4191608)