UriComponents allows "+" in a query param

Issue: SPR-14828
This commit is contained in:
Rossen Stoyanchev
2017-01-18 21:04:37 -05:00
parent 8703cdd9cb
commit f2e293aadf
2 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -189,6 +189,14 @@ public class UriComponentsBuilderTests {
assertEquals("1USD=?EUR", result.getQueryParams().getFirst("q"));
}
@Test // SPR-14828
public void fromUriStringQueryParamEncodedAndContainingPlus() throws Exception {
String httpUrl = "http://localhost:8080/test/print?value=%EA%B0%80+%EB%82%98";
URI uri = UriComponentsBuilder.fromHttpUrl(httpUrl).build(true).toUri();
assertEquals(httpUrl, uri.toString());
}
@Test // SPR-10779
public void fromHttpUrlStringCaseInsesitiveScheme() {
assertEquals("http", UriComponentsBuilder.fromHttpUrl("HTTP://www.google.com").build().getScheme());