Skip to content

Conversation

JLRishe
Copy link

@JLRishe JLRishe commented Dec 25, 2019

There is a bug in the GetCanonicalizedResource() method. It is lowercasing the entire CanonicalizedResource string where it should only be lowercasing the names of the query parameters (c.f. https://github.com/MicrosoftDocs/azure-docs/issues/32933 and MicrosoftDocs/azure-docs@d24bd4b).
As a result, this helper can produce tokens that don't work if the target URL has capital letters in the non-query portion of the URL or any of the parameter values.

The solution is to apply the same change made in MicrosoftDocs/azure-docs@d24bd4b and only lowercase the parameter names, not the whole string.

Additionally, there is an unused signature variable in GetAuthorizationHeader() - the signature is generated once on line 55 and again on line 60, resulting in duplicated code and an unused variable. I have remedied this by making use of the signature variable on line 60.

There is a bug in the GetCanonicalizedResource() method. It is lowercasing the entire CanonicalizedResource string where it should only be lowercasing the names of the query parameters (c.f. https://github.com/MicrosoftDocs/azure-docs/issues/32933 and MicrosoftDocs/azure-docs@d24bd4b#diff-ff9c322cb8f53e3c5e799914eca3cd00). As a result, this helper can produce tokens that don't work if the target URL has capital letters in the non-query portion of the URL or any of the parameter values.

The solution is to apply the same change made in MicrosoftDocs/azure-docs@d24bd4b#diff-ff9c322cb8f53e3c5e799914eca3cd00 and only lowercase the parameter names, not the whole string.


Additionally, there is an unused `signature` variable in `GetAuthorizationHeader()` - the signature is generated once on line 55 and again on line 60, resulting in duplicated code and an unused variable. I have remedied this by making use of the `signature` variable on line 60.
@ProxyTech
Copy link

Please merge this in... I burned half a day trying to figure out what I was doing wrong with the parameters. As this is often used for those just getting started on the REST service with Azure storage, it's really critical that major bugs like this get squashed quickly!

@yangchengs
Copy link

Please merge the pull request. Cx met the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants