Merge branch '5.3.x'
This commit is contained in:
commit
9d65ff73f9
|
@ -407,7 +407,7 @@ public abstract class UriUtils {
|
|||
int paramIndex = path.indexOf(';', begin);
|
||||
end = (paramIndex != -1 && paramIndex < end ? paramIndex : end);
|
||||
int extIndex = path.lastIndexOf('.', end);
|
||||
if (extIndex != -1 && extIndex > begin) {
|
||||
if (extIndex != -1 && extIndex >= begin) {
|
||||
return path.substring(extIndex + 1, end);
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -133,6 +133,7 @@ public class UriUtilsTests {
|
|||
assertThat(UriUtils.extractFileExtension("/products;q=11/view.html?param=/path/a.do")).isEqualTo("html");
|
||||
assertThat(UriUtils.extractFileExtension("/products;q=11/view.html;r=22?param=/path/a.do")).isEqualTo("html");
|
||||
assertThat(UriUtils.extractFileExtension("/products;q=11/view.html;r=22;s=33?param=/path/a.do")).isEqualTo("html");
|
||||
assertThat(UriUtils.extractFileExtension("/products/.html")).isEqualTo("html");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue