Skip to content

Commit 9648b1c

Browse files
committed
Merge branch '5.1.x'
2 parents d972911 + 7b69726 commit 9648b1c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

spring-web/src/main/java/org/springframework/web/util/pattern/InternalPathPatternParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -173,7 +173,7 @@ else if (ch == '*') {
173173

174174
}
175175
else if ((this.pos > (this.variableCaptureStart + 1 + (this.isCaptureTheRestVariable ? 1 : 0)) &&
176-
!Character.isJavaIdentifierPart(ch))) {
176+
!Character.isJavaIdentifierPart(ch) && ch != '-')) {
177177
throw new PatternParseException(this.pos, this.pathPatternData,
178178
PatternMessage.ILLEGAL_CHARACTER_IN_CAPTURE_DESCRIPTOR,
179179
Character.toString(ch));

spring-web/src/test/java/org/springframework/web/util/pattern/PathPatternParserTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ public void completeCapturingPatterns() {
184184
checkStructure("/{foo}");
185185
checkStructure("/{f}/");
186186
checkStructure("/{foo}/{bar}/{wibble}");
187+
checkStructure("/{mobile-number}"); // gh-23101
187188
}
188189

189190
@Test

0 commit comments

Comments
 (0)