Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

clojurewerkz.neocons.rest.nodes/find-one throws URISyntaxException #21

Closed
tutysara opened this Issue · 5 comments

2 participants

@tutysara

clojurewerkz.neocons.rest.nodes/find-one throws URISyntaxException on finding %20(space) character (or any other character that should be encoded) in value when value contains ":"

Steps to recreate

(def record {:url "test" :name "test space:colon"})
(def node (nn/create record))
(def idx-test (nn/create-index "idx-test"))
(nn/add-to-index (:id node) (:name idx-test) "name" (:name record) true)
(nn/find-one (:name idx-test) "name" (:name record))

Probable fix

Modify core.clj in Urly and change encode-path to

(defn ^String encode-path
  [^String s]
  (.replace (URLEncoder/encode s) "+" "%20"))
@tutysara

passes all test cases in neocons with this change, will try to move this to urly and check if the functionality I am testing works, might submit a patch request tomorrow if everything is fine.

@tutysara

Changes are made in urly, passed all test cases in neocons and urly. Submitted a pull request in urly repo.

@michaelklishin

See comments to michaelklishin/urly#2. Also, I don't see any new test cases for Neocons.

@michaelklishin michaelklishin referenced this issue from a commit
Michael Klishin Add a test for #21 1907628
@michaelklishin

1.1.0-beta4 is out. Let me know if it works, then I'll write up an announcement. Thank you!

A long term solution would be to come up with a JVM (probably Java, since all JVM languages are plagued by the URI encoding situation) library that correctly encodes each path segment separately.

@tutysara

Thx a lot for the quick solution. Sorry about missing test cases for neocons. Tested with 1.1.0-beta4 and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.