Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that http client respects the scheme #16

Merged
merged 3 commits into from
Jul 1, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name := "algorithmia-client"

organization := "com.algorithmia"

version := "1.0.15"
version := "1.0.16"

autoScalaLibrary := false

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/algorithmia/algo/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@
* Generally, Algorithms do not need instantiated directly;
* the Algorithmia object has algo(...) helpers to return
* the relevant API object with an instantiated client managed internally
*
*
* @version 1.0.13
*/
package com.algorithmia.algo;
5 changes: 3 additions & 2 deletions src/main/java/com/algorithmia/client/HttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class HttpClient {
final private Auth auth;
final private String apiAddress;

private static String userAgent = "algorithmia-java/" + "1.0.13";
private static String userAgent = "algorithmia-java/" + "1.0.16";

private static List<CloseableHttpAsyncClient> clients = new LinkedList<CloseableHttpAsyncClient>();

Expand Down Expand Up @@ -254,7 +254,8 @@ private <T> Future<T> executeAsync(HttpUriRequest request, HttpAsyncResponseCons
this.auth.authenticateRequest(request);
}
request.addHeader("User-Agent", HttpClient.userAgent);
HttpHost target = new HttpHost(request.getURI().getHost(), request.getURI().getPort());
final URI uri = request.getURI();
final HttpHost target = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme());
return client.execute(new BasicAsyncRequestProducer(target, request), consumer, null);
}

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/algorithmia/client/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
* Generally, the client does not need instantiated directly;
* com.algorithmia.Algorithmia static class methods return the relevant
* API object with an instantiated client managed internally
*
* @version 1.0.13
*/
package com.algorithmia.client;
2 changes: 0 additions & 2 deletions src/main/java/com/algorithmia/data/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
* Generally, Data objectes do not need instantiated directly;
* the Algorithmia object has dir(...) and file(...) helpers to return
* the relevant API object with an instantiated client managed internally
*
* @version 1.0.13
*/
package com.algorithmia.data;
1 change: 0 additions & 1 deletion src/main/java/com/algorithmia/package-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/**
* Package for leveraging Algorithmia's algorithm marketplace and data APIs
* @version 1.0.13
*/
package com.algorithmia;