SPR-6005 - org.springframework.beans.propertyeditors.URIEditor does double escaping for % signes for URIs that contain a schema
This commit is contained in:
@@ -130,4 +130,15 @@ public class URIEditorTests {
|
||||
assertEquals("http://example.com/spaces%20and%20%E2%82%AC", uri.toASCIIString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void encodeAlreadyEncodedURI() throws Exception {
|
||||
PropertyEditor uriEditor = new URIEditor(false);
|
||||
uriEditor.setAsText("http://example.com/spaces%20and%20%E2%82%AC");
|
||||
Object value = uriEditor.getValue();
|
||||
assertTrue(value instanceof URI);
|
||||
URI uri = (URI) value;
|
||||
assertEquals(uri.toString(), uriEditor.getAsText());
|
||||
assertEquals("http://example.com/spaces%20and%20%E2%82%AC", uri.toASCIIString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user