#1902 - Fix link header parsing for multiple links and unquoted attribute values.

Fixed the regular expression to parse link header values to properly consider the comma to end an unquoted attribute value, too. Couple of additional unit tests, too.
This commit is contained in:
Oliver Drotbohm
2023-02-15 10:26:29 +01:00
parent 837608fe44
commit efde43a511
2 changed files with 10 additions and 8 deletions

View File

@@ -55,10 +55,13 @@ class LinksUnitTest {
Link.of("/somethingElse", "bar").withHreflang("de"));
// #1899
static final String FIVE = "</somethingElse>;rel=boo";
static final String FIVE = "</somethingElse?foo=one,two>;rel=boo";
static final String SIX = "</somethingElse>; rel=bee";
static final String LINKS3 = StringUtils.collectionToCommaDelimitedString(Arrays.asList(FIVE, SIX));
static final Links reference3 = Links.of(Link.of("/somethingElse", "boo"), Link.of("/somethingElse", "bee"));
static final String SEVEN = "</somethingElse>;rel=beeboo;title=sometitle";
static final String LINKS3 = StringUtils.collectionToCommaDelimitedString(Arrays.asList(FIVE, SIX, SEVEN));
static final Links reference3 = Links.of(Link.of("/somethingElse?foo=one,two", "boo"), //
Link.of("/somethingElse", "bee"),
Link.of("/somethingElse", "beeboo").withTitle("sometitle"));
@Test
void parsesLinkHeaderLinks() {