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

AWS CLI retrieves HTML from an URL and puts it into the message body instead of just the URL. (SQS) #2577

Closed
Evert-Arends opened this Issue May 2, 2017 · 8 comments

Comments

Projects
None yet
7 participants
@Evert-Arends
Copy link

Evert-Arends commented May 2, 2017

Hello,

I found an interesting feature/bug which is not in the documentation of aws cli.
I use "aws sqs send-message" to put a message into the queue, but the message body is an URL. Usually I would do that through python/node whatever, but for this specific situation I use bash, and of course aws cli. But as I stated, the message body consists of an URL (let's say http://www.bbc.com)
normally that would be the exact message, but aws cli chooses to retrieve the HTML from that URL.

To me it bothers me a lot, because of existing lambda functions that need to be changed, before they can work with the modified version (putting the url between '"' solves the problem).

Test command: aws sqs send-message --queue-url QUEUE URL HERE --message-body "http://www.bbc.com"

Any one who can enlighten me in this particular situation?

Best regards

@DeviaVir

This comment has been minimized.

Copy link

DeviaVir commented May 2, 2017

Confirmed I could reproduce this issue, using the AWS CLI versus the AWS Console and sending the same payload (a URL) would produce different results, the AWS CLI actually dumping HTML. This behaviour seems undocumented and perhaps unintended?

@kyleknap

This comment has been minimized.

Copy link
Member

kyleknap commented May 3, 2017

So the reason you are seeing this is because it is a feature of the CLI that if a value starts with: http:// or https:// it will actually grab the contents for you and use the contents as the value it sends to the API.

Unfortunately, there is no explicit option for turning this off. The best way to get around this would be to use --cli-input-json parameter and provide all of the parameters in a single file or to save the contents of the message in a file and provide the file to the --message parameter using the file:// prefix.

Let us know if that helps of if you have anymore questions.

@Evert-Arends

This comment has been minimized.

Copy link

Evert-Arends commented May 4, 2017

Thank you for your response,

At first I would advise to add this to the documentation. This had me stressed out for a bit.
Second, maybe put the flag to disable the HTML grabbing on the TODO list?

@kyleknap

This comment has been minimized.

Copy link
Member

kyleknap commented May 4, 2017

I agree on both points. I think a flag to disable automatic remote/local content grabbing would be nice because currently there is no great workaround. Marking as feature request.

@vshih

This comment has been minimized.

Copy link

vshih commented May 31, 2017

This workaround works for me:

aws sqs send-message ... --cli-input-json '{"MessageBody": "https://www.google.com"}'

@ASayre

This comment has been minimized.

Copy link
Contributor

ASayre commented Feb 6, 2018

Good Morning!

We're closing this issue here on GitHub, as part of our migration to UserVoice for feature requests involving the AWS CLI.

This will let us get the most important features to you, by making it easier to search for and show support for the features you care the most about, without diluting the conversation with bug reports.

As a quick UserVoice primer (if not already familiar): after an idea is posted, people can vote on the ideas, and the product team will be responding directly to the most popular suggestions.

We’ve imported existing feature requests from GitHub - Search for this issue there!

And don't worry, this issue will still exist on GitHub for posterity's sake. As it’s a text-only import of the original post into UserVoice, we’ll still be keeping in mind the comments and discussion that already exist here on the GitHub issue.

GitHub will remain the channel for reporting bugs.

Once again, this issue can now be found by searching for the title on: https://aws.uservoice.com/forums/598381-aws-command-line-interface

-The AWS SDKs & Tools Team

@ASayre ASayre closed this Feb 6, 2018

@jamesls

This comment has been minimized.

Copy link
Member

jamesls commented Apr 6, 2018

Based on community feedback, we have decided to return feature requests to GitHub issues.

@stealthycoin

This comment has been minimized.

Copy link
Contributor

stealthycoin commented Jul 2, 2018

Closing due to #3398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment