Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Work around bug in java.net.URI for resolving against query string

  • Loading branch information...
commit d55dea8b540cdb2590879d963915fb936802e5d3 1 parent 60f3226
@niklasl authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/rdfa/core.clj
View
8 src/rdfa/core.clj
@@ -35,7 +35,13 @@
(defn resolve-iri [iref base]
(if (not-empty iref)
- (.. (java.net.URI. base) (resolve iref) (normalize) (toString))
+ ; NOTE: work around bug in java.net.URI for resolving against query string
+ ; See e.g. org.apache.http.client.utils.
+ ; URIUtils#resolveReferenceStartingWithQueryString
+ (if (.startsWith iref "?")
+ (str (let [i (.indexOf base "?")]
+ (if (> i -1) (subs base 0 i) base)) iref)
+ (.. (java.net.URI. base) (resolve iref) (normalize) (toString)))
base))
(defn to-iri [s base]
Please sign in to comment.
Something went wrong with that request. Please try again.