|
14 | 14 | [clojure.walk :as walk]) |
15 | 15 | (:import |
16 | 16 | [clojure.lang ExceptionInfo] |
17 | | - [java.net MalformedURLException URISyntaxException URL] |
| 17 | + [java.net MalformedURLException URI URISyntaxException] |
18 | 18 | [java.nio ByteBuffer CharBuffer] |
19 | 19 | [java.nio.channels SocketChannel] |
20 | 20 | [java.nio.charset Charset CoderResult StandardCharsets] |
|
190 | 190 | "Converts the `base-url' map to an ASCII URL. May throw |
191 | 191 | MalformedURLException or URISyntaxException." |
192 | 192 | [{:keys [protocol host port prefix version] :as _base-url} :- base-url-schema] |
193 | | - (-> (URL. protocol host port |
194 | | - (str prefix "/" (name (or version :v4)))) |
195 | | - .toURI .toASCIIString)) |
| 193 | + (-> (URI. protocol nil host port |
| 194 | + (str prefix "/" (name (or version :v4))) nil nil) |
| 195 | + .toASCIIString)) |
196 | 196 |
|
197 | 197 | (pls/defn-validated base-url->str-no-path :- s/Str |
198 | 198 | "Converts the `base-url' map to an ASCII URL minus the path element. This can |
199 | 199 | be used to build a full URL when you have an absolute path." |
200 | 200 | [{:keys [protocol host port] :as _base-url} :- base-url-schema] |
201 | | - (-> (URL. protocol host port "") |
202 | | - .toURI .toASCIIString)) |
| 201 | + (-> (URI. protocol nil host port "" nil nil) |
| 202 | + .toASCIIString)) |
203 | 203 |
|
204 | 204 | (defn base-url->str-with-prefix |
205 | 205 | [{:keys [protocol host port prefix] :as _base-url}] |
206 | | - (-> (java.net.URL. protocol host port prefix) |
207 | | - .toURI |
| 206 | + (-> (URI. protocol nil host port prefix nil nil) |
208 | 207 | .toASCIIString)) |
209 | 208 |
|
210 | 209 | (defn describe-bad-base-url |
|
0 commit comments