clowk 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/clowk/http/client.rb +12 -2
- data/lib/clowk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 724e8bb8826e85a7ca8a5ab0a35252a173ae351914318fdf1e7337b28d0acf24
|
|
4
|
+
data.tar.gz: '0649d40341028b61fa6bc6c5ec48f11d4426db5a3919e231b043b512df5d8676'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d641c9a88626dbadcd07e71aa433c34526c4e5de64e4727c593ceff50d227ca29ab8cee2352f0f69912e98b10dc4e341e81aa2382be49db192937a7b7fc7a3c
|
|
7
|
+
data.tar.gz: 6d896475327369927e31eb9ea02c40d635739b945cd01389a2431d2717030364d99fff4eac03b6f10a084a00c80dc0381b5b3d9cf55ce9f5337960b364a19152
|
data/lib/clowk/http/client.rb
CHANGED
|
@@ -137,12 +137,22 @@ module Clowk
|
|
|
137
137
|
|
|
138
138
|
def build_uri(path)
|
|
139
139
|
base_uri = URI(base_url)
|
|
140
|
-
|
|
141
|
-
base_uri.
|
|
140
|
+
request_path, request_query = split_query(path)
|
|
141
|
+
base_uri.path = join_paths(base_uri.path, normalize_path(request_path))
|
|
142
|
+
base_uri.query = request_query
|
|
142
143
|
base_uri.fragment = nil
|
|
143
144
|
base_uri
|
|
144
145
|
end
|
|
145
146
|
|
|
147
|
+
# A request path may arrive with its query already attached (the SDK's
|
|
148
|
+
# `search` builds "resource/search?query=..."). URI#path= rejects a value
|
|
149
|
+
# containing "?", so split the query off and set it as its own component
|
|
150
|
+
# instead of smuggling it through the path.
|
|
151
|
+
def split_query(path)
|
|
152
|
+
path_part, _separator, query_part = path.to_s.partition("?")
|
|
153
|
+
[path_part, query_part.empty? ? nil : query_part]
|
|
154
|
+
end
|
|
155
|
+
|
|
146
156
|
def normalize_path(path)
|
|
147
157
|
path.to_s.start_with?("/") ? path : "/#{path}"
|
|
148
158
|
end
|
data/lib/clowk/version.rb
CHANGED