Skip to content

Commit

Permalink
Avoid escaping ‘;’ and ‘$’ in GlideUrl.
Browse files Browse the repository at this point in the history
Fixes #2583.
  • Loading branch information
sjudd committed Nov 9, 2017
1 parent c75e2a6 commit 014bf44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* convenience. </p>
*/
public class GlideUrl implements Key {
private static final String ALLOWED_URI_CHARS = "@#&=*+-_.,:!?()/~'%";
private static final String ALLOWED_URI_CHARS = "@#&=*+-_.,:!?()/~'%;$";
private final Headers headers;
@Nullable private final URL url;
@Nullable private final String stringUrl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.bumptech.glide.load.model;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;

Expand Down Expand Up @@ -87,6 +88,16 @@ public void testIssue133() throws MalformedURLException {
assertEquals(escaped, glideUrlFromEscapedUrl.toURL().toString());
}

@Test
public void issue_2583() throws MalformedURLException {
String original =
"http://api.met.no/weatherapi/weathericon/1.1/?symbol=9;content_type=image/png";

GlideUrl glideUrl = new GlideUrl(original);
assertThat(glideUrl.toURL().toString()).isEqualTo(original);
assertThat(glideUrl.toStringUrl()).isEqualTo(original);
}

@Test
public void testEquals() throws MalformedURLException {
Headers headers = mock(Headers.class);
Expand Down

0 comments on commit 014bf44

Please sign in to comment.