-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: paging breaks with + sign on phone number (#571)
- Loading branch information
1 parent
4548332
commit 2f5b9d5
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,4 +372,4 @@ | |
<artifactId>oss-parent</artifactId> | ||
<version>7</version> | ||
</parent> | ||
</project> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,22 @@ public void testConstructURLWithPipe() throws MalformedURLException { | |
assertUrlsEqual(expected, url); | ||
} | ||
|
||
@Test | ||
public void testConstructURLWithMultipleSlashes() throws MalformedURLException { | ||
Request r = new Request(HttpMethod.GET, Domains.API.toString(), "/2010-04-01/foo|bar/bar|foo"); | ||
URL url = r.constructURL(); | ||
URL expected = new URL("https://api.twilio.com/2010-04-01/foo%7Cbar/bar%7Cfoo"); | ||
assertUrlsEqual(expected, url); | ||
} | ||
|
||
@Test | ||
public void testConstructURLWithCredentials() throws MalformedURLException { | ||
Request r = new Request(HttpMethod.GET, "user:pass@" + Domains.API.toString(), "/2010-04-01/foobar"); | ||
URL url = r.constructURL(); | ||
URL expected = new URL("https://user:[email protected]/2010-04-01/foobar"); | ||
assertUrlsEqual(expected, url); | ||
} | ||
|
||
@Test | ||
public void testConstructURLWithParam() throws MalformedURLException { | ||
Request r = new Request(HttpMethod.GET, Domains.API.toString(), "/2010-04-01/foobar"); | ||
|
@@ -72,6 +88,15 @@ public void testConstructURLWithParams() throws MalformedURLException { | |
assertUrlsEqual(expected, url); | ||
} | ||
|
||
@Test | ||
public void testConstructURLWithPlusPrefix() { | ||
Request r = new Request(HttpMethod.GET, Domains.API.toString(), "/2010-04-01/foobar"); | ||
r.addQueryParam("To", "+18888888888"); | ||
URL url = r.constructURL(); | ||
String expected = "https://api.twilio.com/2010-04-01/foobar?To=%2B18888888888"; | ||
assertEquals(expected, url.toString()); | ||
} | ||
|
||
@Test | ||
public void testConstructURLWithMultivaluedParam() throws MalformedURLException { | ||
Request r = new Request(HttpMethod.GET, Domains.API.toString(), "/2010-04-01/foobar"); | ||
|