Skip to content

Commit 4187435

Browse files
authored
Merge pull request #2208 from basho/dpb/fix_broken_redirects
Strip leading '/'s from redirects
2 parents de152b4 + 0938b88 commit 4187435

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

rake_libs/s3_deploy.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,11 @@ def do_deploy()
362362
# routing rule per project.
363363
routing_rules = []
364364
config_file['params']['project_descriptions'].each do |project, description|
365-
path = description['path']
366-
archived_path = description['archived_path']
365+
# These paths come with leading `/`s (which is correct), but the routing rules
366+
# assume a relative path (which is also correct). To account for this, we
367+
# strip the leading slashes here.
368+
path = description['path'][1..-1]
369+
archived_path = description['archived_path'][1..-1]
367370
ver = description['latest']
368371
routing_rules.push(
369372
{
@@ -396,7 +399,7 @@ def do_deploy()
396399
end
397400
#TODO: We need to implement some way of adding arbitrary routing rules. Maybe
398401
# add a section in config.yaml that's just a JSON string that we parse?
399-
riak_path = config_file['params']['project_descriptions']['riak_kv']['path']
402+
riak_path = config_file['params']['project_descriptions']['riak_kv']['path'][1..-1]
400403
riak_ver = config_file['params']['project_descriptions']['riak_kv']['latest']
401404
routing_rules.push(
402405
{

0 commit comments

Comments
 (0)