|
84 | 84 | UniformResourceIdentifier |
85 | 85 | (scheme [self] (:scheme data)) |
86 | 86 | (scheme [self new-scheme] (-> (assoc data :scheme new-scheme) |
| 87 | + (build/prepare-map) |
87 | 88 | (parse/clean-map *uri-keys*) |
88 | 89 | (Uri. metadata))) |
89 | 90 | (scheme-relative [self] (:scheme-relative data)) |
|
92 | 93 | ssp-data (parse/scheme-specific ssp) |
93 | 94 | auth-data (parse/authority (:authority ssp-data))] |
94 | 95 | (-> (merge new-data ssp-data auth-data) |
| 96 | + (build/prepare-map) |
95 | 97 | (parse/clean-map *uri-keys*) |
96 | 98 | (Uri. metadata)))) |
97 | 99 | (authority [self] (:authority data)) |
98 | 100 | (authority [self authority] |
99 | 101 | (let [new-data (assoc data :authority authority) |
100 | 102 | auth-data (parse/authority authority)] |
101 | 103 | (-> (merge new-data auth-data) |
| 104 | + (build/prepare-map) |
102 | 105 | (parse/clean-map *uri-keys*) |
103 | 106 | (Uri. metadata)))) |
104 | 107 | (user-info [self] (:user-info data)) |
|
109 | 112 | ssp (build/scheme-specific new-data) |
110 | 113 | new-data (assoc new-data :scheme-relative ssp)] |
111 | 114 | (-> new-data |
| 115 | + (build/prepare-map) |
112 | 116 | (parse/clean-map *uri-keys*) |
113 | 117 | (Uri. metadata)))) |
114 | 118 | (host [self] (:host self)) |
|
119 | 123 | ssp (build/scheme-specific new-data) |
120 | 124 | new-data (assoc new-data :scheme-relative ssp)] |
121 | 125 | (-> new-data |
| 126 | + (build/prepare-map) |
122 | 127 | (parse/clean-map *uri-keys*) |
123 | 128 | (Uri. metadata)))) |
124 | 129 | (port [self] (:port self)) |
|
131 | 136 | ssp (build/scheme-specific new-data) |
132 | 137 | new-data (assoc new-data :scheme-relative ssp)] |
133 | 138 | (-> new-data |
| 139 | + (build/prepare-map) |
134 | 140 | (parse/clean-map *uri-keys*) |
135 | 141 | (Uri. metadata)))) |
136 | 142 | (path [self] (:path self)) |
|
139 | 145 | ssp (build/scheme-specific new-data) |
140 | 146 | new-data (assoc new-data :scheme-relative ssp)] |
141 | 147 | (-> new-data |
| 148 | + (build/prepare-map) |
142 | 149 | (parse/clean-map *uri-keys*) |
143 | 150 | (Uri. metadata)))) |
144 | 151 | (query [self] (:query self)) |
|
147 | 154 | ssp (build/scheme-specific new-data) |
148 | 155 | new-data (assoc new-data :scheme-relative ssp)] |
149 | 156 | (-> new-data |
| 157 | + (build/prepare-map) |
150 | 158 | (parse/clean-map *uri-keys*) |
151 | 159 | (Uri. metadata)))) |
152 | 160 | (fragment [self] (:fragment self)) |
153 | 161 | (fragment [self fragment] |
154 | 162 | (-> (assoc data :fragment fragment) |
| 163 | + (build/prepare-map) |
155 | 164 | (parse/clean-map *uri-keys*) |
156 | 165 | (Uri. metadata))) |
157 | 166 |
|
|
168 | 177 | :path (path self value) |
169 | 178 | :query (query self value) |
170 | 179 | :fragment (fragment self value) |
171 | | - (Uri. (assoc data key value) metadata))) |
| 180 | + (Uri. (parse/clean-map (build/prepare-map (assoc data key value)) *uri-keys*) metadata))) |
172 | 181 | (entryAt [_ key] (find data key)) |
173 | 182 |
|
174 | 183 | clojure.lang.ILookup |
|
190 | 199 | :path (path self nil) |
191 | 200 | :query (query self nil) |
192 | 201 | :fragment (fragment self nil) |
193 | | - (Uri. (dissoc data key) metadata))) |
| 202 | + (Uri. (parse/clean-map (build/prepare-map (dissoc data key)) *uri-keys*) metadata))) |
194 | 203 |
|
195 | 204 | Iterable |
196 | 205 | (iterator [_] (.iterator data)) |
@@ -252,9 +261,9 @@ another Uri object." |
252 | 261 | [uri] |
253 | 262 | (condp instance? uri |
254 | 263 | Uri uri |
255 | | - clojure.lang.IPersistentMap (Uri. uri (meta uri)) |
256 | | - java.lang.String (Uri. (parse/uri uri) nil) |
257 | | - (Uri. (-> uri str str parse/uri) nil))) |
| 264 | + clojure.lang.IPersistentMap (Uri. (parse/clean-map (build/prepare-map uri) *uri-keys*) (meta uri)) |
| 265 | + java.lang.String (Uri. (parse/clean-map (build/prepare-map (parse/uri uri)) *uri-keys*) nil) |
| 266 | + (Uri. (-> uri str str parse/uri build/prepare-map (parse/clean-map *uri-keys*)) nil))) |
258 | 267 |
|
259 | 268 | (extend java.net.URI |
260 | 269 | UniformResourceIdentifier |
|
0 commit comments