removed converting url to uri before getting path to avoid decoding

This commit is contained in:
Parvathi Mallampalli 2021-08-27 13:29:13 -07:00
parent ed47f54a61
commit 706c72d6f1
2 changed files with 13 additions and 7 deletions

View File

@ -73,13 +73,8 @@ class SignableRequestImpl implements SignableRequest<Request> {
@Override
public String getResourcePath() {
try {
return originalRequest.url()
.toURI()
.getPath();
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
return originalRequest.url()
.getPath();
}
@Override

View File

@ -68,6 +68,17 @@ public class SignableRequestImplTest {
assertEquals("/request/library", underTest.getResourcePath());
}
@Test
public void getResourcePathWithPoundChar() {
testRequest = new Request.Builder()
.url("http://www.amazon.com/request/%23library")
.get()
.build();
underTest = new SignableRequestImpl(testRequest);
assertEquals("/request/%23library", underTest.getResourcePath());
}
@Test
public void noTimeOffset() {
assertEquals(0, underTest.getTimeOffset());