#686 - Support whitespace in Links header (RFC 5988).

RFC 5988 (https://tools.ietf.org/html/rfc5988#section-5.5) has clear examples of whitespace in link headers. This commit introduces support (and tests) to support these spec cases.
This commit is contained in:
Christian Bühler
2018-01-03 14:24:49 +01:00
committed by Greg Turnquist
parent 13db7c7fb2
commit 21719bb041
4 changed files with 11 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ import org.springframework.util.StringUtils;
*/
public class Links implements Iterable<Link> {
private static final Pattern LINK_HEADER_PATTERN = Pattern.compile("(<[^>]*>(;\\w+=\"[^\"]*\")+)");
private static final Pattern LINK_HEADER_PATTERN = Pattern.compile("(<[^>]*>(;\\s*\\w+=\"[^\"]*\")+)");
static final Links NO_LINKS = new Links(Collections.emptyList());