duracloud-client 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36e3c1de47db33c4726afabdafce50534028f1ab
4
- data.tar.gz: 45d3130e4f61ff3dc6ef0d2575c6c59f18a882ae
3
+ metadata.gz: f562bbe280990009391a82bc2480a8b829622eff
4
+ data.tar.gz: 25b2dec1653acd45e707a21b0b2d80c27728baaf
5
5
  SHA512:
6
- metadata.gz: 38d9045baee5637769976908f3add414414b59e5b7aa2f5dd3011f0ad00c4fe601bf78fdfc3af90dd1bcdaf54e63434a8d90eeb8333708070894aae2b26267b3
7
- data.tar.gz: c2efe8e7282a5e75d10b01db0a2561d770deb91043d89990c7820f62508e488e840cdc2819d90a05261571c32be1fa61d43f4b91e55cea4ec83e1dfc1c3bee04
6
+ metadata.gz: 742c9b3da2bb773f25f0cd4521981cb65fa1e620f74a8028ff31ddafc5d3eb0359e1a4ed2450fc718b7d25d9c2de2da6d57282d77e22b750306f07862eda183d
7
+ data.tar.gz: d909359cb467c461d89854eca31cc5c116db8c6d782ea5fed0daf13db8a1a540fbddf6ded1fc550772cd7420cec62d92685255c8b81cf0c949ab59960d1f229e
@@ -91,7 +91,8 @@ module Duracloud
91
91
  end
92
92
 
93
93
  def durastore_content(http_method, space_id, content_id, **options)
94
- url = [ space_id, content_id ].join("/")
94
+ escaped_content_id = content_id.gsub(/%/, "%25")
95
+ url = [ space_id, escaped_content_id ].join("/")
95
96
  durastore(http_method, url, **options)
96
97
  end
97
98
 
@@ -1,3 +1,3 @@
1
1
  module Duracloud
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -111,6 +111,11 @@ module Duracloud
111
111
  subject.get_content("foo", "bar")
112
112
  expect(stub).to have_been_requested
113
113
  }
114
+ it "escapes percent signs in the content id" do
115
+ stub = stub_request(:get, "https://example.com/durastore/foo/z/z/bar%252Fbaz")
116
+ subject.get_content("foo", "z/z/bar%2Fbaz")
117
+ expect(stub).to have_been_requested
118
+ end
114
119
  specify {
115
120
  stub = stub_request(:get, "https://example.com/durastore/foo/bar")
116
121
  .with(query: {storeID: 1})
@@ -125,6 +130,11 @@ module Duracloud
125
130
  subject.get_content_properties("foo", "bar")
126
131
  expect(stub).to have_been_requested
127
132
  }
133
+ it "escapes percent signs in the content id" do
134
+ stub = stub_request(:head, "https://example.com/durastore/foo/z/z/bar%252Fbaz")
135
+ subject.get_content_properties("foo", "z/z/bar%2Fbaz")
136
+ expect(stub).to have_been_requested
137
+ end
128
138
  specify {
129
139
  stub = stub_request(:head, "https://example.com/durastore/foo/bar")
130
140
  .with(query: {storeID: 1})
@@ -141,6 +151,13 @@ module Duracloud
141
151
  headers: {'x-dura-meta-owner'=>'testuser'})
142
152
  expect(stub).to have_been_requested
143
153
  }
154
+ it "escapes percent signs in the content id" do
155
+ stub = stub_request(:post, "https://example.com/durastore/foo/z/z/bar%252Fbaz")
156
+ .with(headers: {'x-dura-meta-owner'=>'testuser'})
157
+ subject.set_content_properties("foo", "z/z/bar%2Fbaz",
158
+ headers: {'x-dura-meta-owner'=>'testuser'})
159
+ expect(stub).to have_been_requested
160
+ end
144
161
  specify {
145
162
  stub = stub_request(:post, "https://example.com/durastore/foo/bar")
146
163
  .with(headers: {'x-dura-meta-owner'=>'testuser'},
@@ -168,6 +185,21 @@ module Duracloud
168
185
  })
169
186
  expect(stub).to have_been_requested
170
187
  }
188
+ it "escapes percent signs in the content id" do
189
+ stub = stub_request(:put, "https://example.com/durastore/foo/z/z/bar%252Fbaz")
190
+ .with(body: "File content",
191
+ headers: {
192
+ 'Content-Type'=>'text/plain',
193
+ 'Content-MD5'=>'8bb2564936980e92ceec8a5759ec34a8'
194
+ })
195
+ subject.store_content("foo", "z/z/bar%2Fbaz",
196
+ body: "File content",
197
+ headers: {
198
+ 'Content-Type'=>'text/plain',
199
+ 'Content-MD5'=>'8bb2564936980e92ceec8a5759ec34a8'
200
+ })
201
+ expect(stub).to have_been_requested
202
+ end
171
203
  specify {
172
204
  stub = stub_request(:put, "https://example.com/durastore/foo/bar")
173
205
  .with(body: "File content",
@@ -193,6 +225,11 @@ module Duracloud
193
225
  subject.delete_content("foo", "bar")
194
226
  expect(stub).to have_been_requested
195
227
  }
228
+ it "escapes percent signs in the content id" do
229
+ stub = stub_request(:delete, "https://example.com/durastore/foo/z/z/bar%252Fbaz")
230
+ subject.delete_content("foo", "z/z/bar%2Fbaz")
231
+ expect(stub).to have_been_requested
232
+ end
196
233
  specify {
197
234
  stub = stub_request(:delete, "https://example.com/durastore/foo/bar")
198
235
  .with(query: {storeID: 1})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duracloud-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chandek-Stark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-29 00:00:00.000000000 Z
11
+ date: 2016-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie