Skip to content

Commit bce35b1

Browse files
Merge branch 'release/v1.0.1'
2 parents 66a036d + 4748e9b commit bce35b1

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

filepicker_client.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = "filepicker_client"
3-
s.version = "1.0.0"
3+
s.version = "1.0.1"
44
s.date = "2013-07-25"
55
s.summary = "Filepicker.io Client"
66
s.description = "A simple library for interfacing with the Filepicker.io REST API"

lib/filepicker_client.rb

+12-11
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ def store(file, path=nil)
113113
signage = sign(path: path, call: :store)
114114

115115
uri = URI.parse(FP_API_PATH)
116-
uri.query = URI.encode_www_form(
116+
query_params = {
117117
key: @api_key,
118118
signature: signage[:signature],
119-
policy: signage[:encoded_policy],
120-
path: signage[:policy]['path']
121-
)
122-
119+
policy: signage[:encoded_policy]
120+
}
121+
query_params[:path] = signage[:policy]['path'] if path
122+
uri.query = URI.encode_www_form(query_params)
123123
resource = get_fp_resource uri
124124

125125
response = resource.post fileUpload: file
@@ -142,12 +142,13 @@ def store_url(file_url, path=nil)
142142
signage = sign(path: path, call: :store)
143143

144144
uri = URI.parse(FP_API_PATH)
145-
uri.query = URI.encode_www_form(
145+
query_params = {
146146
key: @api_key,
147147
signature: signage[:signature],
148-
policy: signage[:encoded_policy],
149-
path: signage[:policy]['path']
150-
)
148+
policy: signage[:encoded_policy]
149+
}
150+
query_params[:path] = signage[:policy]['path'] if path
151+
uri.query = URI.encode_www_form(query_params)
151152

152153
resource = get_fp_resource uri
153154

@@ -192,9 +193,9 @@ def convert_and_store(handle, path=nil, options={})
192193
key: @api_key,
193194
signature: signage[:signature],
194195
policy: signage[:encoded_policy],
195-
storeLocation: 'S3',
196-
storePath: signage[:policy]['path']
196+
storeLocation: 'S3'
197197
)
198+
options[:storePath] = signage[:policy]['path'] if path
198199
uri.query = URI.encode_www_form(options)
199200

200201
resource = get_fp_resource uri

0 commit comments

Comments
 (0)