0

I'm running into an AWS SimpleDB signing problem when sending a SELECT request and I'm stumped. The worst part is that it appears to be performing inconsistently.

When I select as below it's fine and works perfectly: select itemName() from Race limit 3 which is encoded as select%20itemName%28%29%20from%20Race%20limit%203 - of course adding all of the other attributes before signing.

When I change the SELECT limit to 1 (rather than 3) select itemName() from Race limit 1 it encodes as select%20itemName%28%29%20from%20Race%20limit%201 and the signatures don't match when I submit the query to AWS (everything else identical).

My theory is that the last four characters are being read as a %201 rather than a %20 followed by a 1 - is that possible? If so, is it possible to "encode" around it?

2 Answers2

0

My theory is that the last four characters are being read as a %201 rather than a %20 followed by a 1 - is that possible? If so, is it possible to "encode" around it?

Your theory is correct. Try something like this:

select itemName() from Race limit 1 it encodes as select%20itemName%28%29%20from%20Race%20limit%20%31

stiabhan
  • 381
  • 1
  • 5
  • Thanks @stiabhan - just tried that and it didn't work (same signature match issue) - it seems that AWS doesn't like me encoding things like digits (which it doesn't expect me to encode). – BeerNathan Aug 10 '14 at 09:16
  • I don't understand the justification for the comment, "your theory is correct." Why is it correct? What would explain the behavior difference between %203 and %201? – Michael - sqlbot Aug 10 '14 at 16:28
0

I've got to the bottom of this...

It's not an encoding issue - there can only by two characters after the %, so AWS was seeing it as %20 and a 1. The problem was that limiting the result to 1 forced AWS to include a paging token in the response. Limiting to 3 didn't return the token (there were only 3 results).

It appears that the software I'm using (CoronaSDK) is choking on the content when a token is included and just not providing it back to my app.