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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23e593a98742fb2d99e89bcec77d30c250300f1ce40789ebadd82277548419d8
4
- data.tar.gz: 0acb397f16bca42b0599cf2ab1e8c223010ea2ae1bb7f7031700e2cdb568f293
3
+ metadata.gz: 724e8bb8826e85a7ca8a5ab0a35252a173ae351914318fdf1e7337b28d0acf24
4
+ data.tar.gz: '0649d40341028b61fa6bc6c5ec48f11d4426db5a3919e231b043b512df5d8676'
5
5
  SHA512:
6
- metadata.gz: 4b9cccf22eb2a0760dc0b949ac2021d6f509456424be2d93286af8fe47727a5853eee1dc06a8d5b934725288bc682ff34b74fe85e15c547877f9a78705d520f5
7
- data.tar.gz: 515c0d900a8afada712f6aa2252fba6415afe3975db242c053131ae2749a127575adba4c801ca9d44ff27161cc4de660ec15fab89eba350cb61844efe55d54fa
6
+ metadata.gz: 9d641c9a88626dbadcd07e71aa433c34526c4e5de64e4727c593ceff50d227ca29ab8cee2352f0f69912e98b10dc4e341e81aa2382be49db192937a7b7fc7a3c
7
+ data.tar.gz: 6d896475327369927e31eb9ea02c40d635739b945cd01389a2431d2717030364d99fff4eac03b6f10a084a00c80dc0381b5b3d9cf55ce9f5337960b364a19152
@@ -137,12 +137,22 @@ module Clowk
137
137
 
138
138
  def build_uri(path)
139
139
  base_uri = URI(base_url)
140
- base_uri.path = join_paths(base_uri.path, normalize_path(path))
141
- base_uri.query = nil
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Clowk
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clowk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clowk