Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set website-redirect with http:// or https:// prefix #1130

Closed
csexton opened this issue Feb 5, 2015 · 1 comment · Fixed by #1137
Closed

Unable to set website-redirect with http:// or https:// prefix #1130

csexton opened this issue Feb 5, 2015 · 1 comment · Fixed by #1137
Labels
bug This issue is a bug. s3

Comments

@csexton
Copy link

csexton commented Feb 5, 2015

Passing in a URL into the --website-redirect option is considered invalid, despite including a valid prefix.

% aws s3 cp --website-redirect 'http://otherserver.com' /var/folders/mr/hp5q732j74b25ht_d_2tn8bh0000gn/T/redirect.XXXXXX.2RcCGLGT s3://mys3bucket.server.com/path/to/index.html
upload failed: ../../../../var/folders/mr/hp5q732j74b25ht_d_2tn8bh0000gn/T/redirect.XXXXXX.2RcCGLGT to s3://mys3bucket.server.com/path/to/index.html 
A client error (InvalidRedirectLocation) occurred when calling the PutObject operation: 
  The website redirect location must have a prefix of 'http://' or 'https://' or '/'.

I have tried with both http and https (however if I use https on a site that doesn't have a valid cert I get a ssl error). Also tried a variety of escaping and quoting the url including, none of which worked 😢

  • aws s3 cp --website-redirect 'http://otherserver.com' file s3://mys3bucket/path/file
  • aws s3 cp --website-redirect "http://otherserver.com" file s3://mys3bucket/path/file
  • aws s3 cp --website-redirect http://otherserver.com file s3://mys3bucket/path/file
  • aws s3 cp --website-redirect http:\/\/otherserver.com file s3://mys3bucket/path/file
  • aws s3 cp --website-redirect https://otherserver.com file s3://mys3bucket/path/file
  • aws s3 cp file s3://mys3bucket/path/file --website-redirect "http://otherserver.com"

I was able to roll back to version 1.4 and get the command to work again.

@kyleknap
Copy link
Contributor

kyleknap commented Feb 9, 2015

I can reproduce the issue as well. It makes sense that it works again in 1.4 because that was around the time we made the switch on some of the internals of the s3 commands.

The --website-redirect argument is trying to using the contents at that web address since it is a feature in the CLI that if you prepend an argument values with http:// or https://, it will try to retrieve the contents of the web address and use that as the value to the argument.

The solution is that we must black list that feature from this argument. Working on a fix for it.

@kyleknap kyleknap added s3 bug This issue is a bug. confirmed labels Feb 9, 2015
thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this issue Feb 12, 2022
* chore(version): set 0.14.3.dev1 version (aws#1112) (aws#1113)

* Depend on development version of lambda-builders for dev builds (aws#1111)

* Depend on development version of lambda-builders for dev builds

* Adding prod.txt to manifest

* Splitting dev and tool dependencies

* fix(build): Resolve path after .aws-sam is created (aws#1110)

* fix(build): Resolve path after .aws-sam is created

* fix: build (make pr)

* Design and implementation for producing debug build artifacts (aws#1095)

* design: Initial Design for producing debug artifacts

* initial implementation

* Adding unit tests

* Integration test with debug build mode

* Adjust Design doc and add keyword arg to a call

* fix(dotnet): init template fixes (aws#1117)

* chore(version): set 0.15.0 (aws#1125)

* Revert "Depend on development version of lambda-builders for dev builds (aws#1111)" (aws#1128)

This reverts commit 7e9de790e23791ba176faff2030286db4007e503.

* Bumping to Lambda Builders 0.3.0 (aws#1129)

Bumping to Lambda Builders 0.3.0

* fix(func-tests): add dependency manager param (aws#1130)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. s3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants