requests icon indicating copy to clipboard operation
requests copied to clipboard

Allow semicolon in the href of Link header

Open ibnesayeed opened this issue 4 years ago • 1 comments

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&amp;oldid=934259284>; rel="original", <https://web.archive.org/web/timemap/link/https://en.wikipedia.org/w/index.php?title=COVID-19_pandemic&amp;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.

ibnesayeed avatar May 19 '20 23:05 ibnesayeed

@nateprewitt is there anything we can to do to get it merged?

ibnesayeed avatar Aug 10 '20 21:08 ibnesayeed