requests
requests copied to clipboard
Allow semicolon in the href of Link header
Semicolons are valid characters in URIs, splitting them while parsing the Link
header results in unexpected token and wrong url
attribute (notice ;oldid=934259284
portion the below example).
<https://en.wikipedia.org/w/index.php?title=COVID-19_pandemic&oldid=934259284>; rel="original", <https://web.archive.org/web/timemap/link/https://en.wikipedia.org/w/index.php?title=COVID-19_pandemic&oldid=934259284>; rel="timemap"; type="application/link-format"
This PR attempts to fix current parsing issue and also renames a variable to better reflect the purpose of it.
I would note here that this parser still is far from perfect and can be better implemented using state machine.
@nateprewitt is there anything we can to do to get it merged?