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

Missing URL encoding of data_uri #5

Closed
Argoday opened this issue Sep 22, 2015 · 1 comment
Closed

Missing URL encoding of data_uri #5

Argoday opened this issue Sep 22, 2015 · 1 comment
Labels

Comments

@Argoday
Copy link
Contributor

Argoday commented Sep 22, 2015

This line fails:
Algorithmia.client().file("data://.my/This is a valid filename ☘.txt").put("hi");

The client should perform a URLEncode operation prior to sending HTTP requests for data_uris

@Argoday Argoday changed the title Missing Missing URL encoding of data_uri Sep 22, 2015
@Argoday Argoday added the bug label Sep 22, 2015
@Argoday
Copy link
Contributor Author

Argoday commented Sep 22, 2015

Stacktrace:

Error: java.lang.IllegalArgumentException: Illegal character in path at index 43: http://172.17.42.1:4160/v1/data/.my/he/test file ☘.txt
java.lang.IllegalArgumentException: Illegal character in path at index 43: http://172.17.42.1:4160/v1/data/.my/he/test file ☘.txt (Illegal character in path at index 43: http://172.17.42.1:4160/v1/data/.my/he/test file ☘.txt)
at java.net.URI.create(URI.java:852)
at org.apache.http.client.methods.HttpPut.(HttpPut.java:68)
at com.algorithmia.client.HttpClient.put(HttpClient.java:90)
at com.algorithmia.data.DataFile.put(DataFile.java:91)
at algorithmia.AwesomeJava2.AwesomeJava2.apply(AwesomeJava2.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at algorithmia.runners.JavaRunner$.applyInput(JavaRunner.scala:234)
at algorithmia.runners.JavaRunner$.algorithmia$runners$JavaRunner$$tryFullBodyApply(JavaRunner.scala:229)
at algorithmia.runners.JavaRunner$$anonfun$applyString$3.apply(JavaRunner.scala:56)
at algorithmia.runners.JavaRunner$$anonfun$applyString$3.apply(JavaRunner.scala:53)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
at algorithmia.runners.JavaRunner$.applyString(JavaRunner.scala:53)
at algorithmia.runners.JarRunner.run(JarRunner.scala:53)
at algorithmia.runners.AlgoRunner$$anonfun$invoke$1.apply$mcV$sp(AlgoRunner.scala:27)
at algorithmia.runners.AlgoRunner$$anonfun$invoke$1.apply(AlgoRunner.scala:23)
at algorithmia.runners.AlgoRunner$$anonfun$invoke$1.apply(AlgoRunner.scala:23)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: Illegal character in path at index 43: http://172.17.42.1:4160/v1/data/.my/he/test file ☘.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant