Skip to content

Commit

Permalink
Issue #222
Browse files Browse the repository at this point in the history
  • Loading branch information
gondor committed Jan 27, 2015
1 parent 2d210a4 commit 5dfeecd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Expand Up @@ -81,7 +81,7 @@ public String getStatusMessage() {
* @return the input stream
*/
public InputStream getInputStream() {
return (InputStream) response.getEntity();
return response.getEntity(InputStream.class);
}

/**
Expand Down
Expand Up @@ -19,9 +19,13 @@ public class EndpointURIFromRequestFunction implements Function<HttpRequest<?>,
@Override
public String apply(HttpRequest<?> request) {
if (request.getEndpoint().endsWith(URI_SEP) || request.getPath().startsWith(URI_SEP))
return request.getEndpoint() + request.getPath();
return escape(request.getEndpoint() + request.getPath());

return request.getEndpoint() + URI_SEP + request.getPath();
return escape(request.getEndpoint() + URI_SEP + request.getPath());
}

private String escape(String uri) {
return uri.replaceAll(" ", "%20");
}

}

0 comments on commit 5dfeecd

Please sign in to comment.