removed converting url to uri before getting path to avoid decoding
This commit is contained in:
parent
ed47f54a61
commit
706c72d6f1
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue