File tree 4 files changed +11
-3
lines changed
main/java/org/springframework/hateoas
test/java/org/springframework/hateoas
4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 4
4
env :
5
5
matrix :
6
6
- PROFILE=non-existant
7
- - PROFILE=spring43-next
8
- - PROFILE=spring5
9
7
- PROFILE=spring5-next
10
8
addons :
11
9
apt :
Original file line number Diff line number Diff line change 88
88
<id >spring5-next</id >
89
89
<properties >
90
90
<spring .version>5.0.2.BUILD-SNAPSHOT</spring .version>
91
+ <jackson .version>2.9.2</jackson .version>
91
92
</properties >
92
93
<repositories >
93
94
<repository >
Original file line number Diff line number Diff line change 35
35
*/
36
36
public class Links implements Iterable <Link > {
37
37
38
- private static final Pattern LINK_HEADER_PATTERN = Pattern .compile ("(<[^>]*>(;\\ w+=\" [^\" ]*\" )+)" );
38
+ private static final Pattern LINK_HEADER_PATTERN = Pattern .compile ("(<[^>]*>(;\\ s* \\ w+=\" [^\" ]*\" )+)" );
39
39
40
40
static final Links NO_LINKS = new Links (Collections .emptyList ());
41
41
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ public class LinksUnitTest {
34
34
static final String FIRST = "</something>;rel=\" foo\" " ;
35
35
static final String SECOND = "</somethingElse>;rel=\" bar\" " ;
36
36
static final String WITH_COMMA = "<http://localhost:8080/test?page=0&filter=foo,bar>;rel=\" foo\" " ;
37
+ static final String WITH_WHITESPACE = "</something>; rel=\" foo\" ," + SECOND ;
37
38
38
39
static final String LINKS = StringUtils .collectionToCommaDelimitedString (Arrays .asList (FIRST , SECOND ));
39
40
@@ -93,4 +94,12 @@ public void parsesLinkWithComma() {
93
94
assertThat (twoWithCommaInFirst .getLink ("foo" )).hasValue (withComma );
94
95
assertThat (twoWithCommaInFirst .getLink ("bar" )).hasValue (new Link ("/somethingElse" , "bar" ));
95
96
}
97
+
98
+ /**
99
+ * @see https://tools.ietf.org/html/rfc5988#section-5.5
100
+ */
101
+ @ Test
102
+ public void parsesLinksWithWhitespace () {
103
+ assertThat (Links .valueOf (WITH_WHITESPACE )).isEqualTo (reference );
104
+ }
96
105
}
You can’t perform that action at this time.
0 commit comments