Fix incorrect lowercasing in GetCanonicalizedResource#12
Open
JLRishe wants to merge 2 commits intoAzure-Samples:masterfrom
Open
Fix incorrect lowercasing in GetCanonicalizedResource#12JLRishe wants to merge 2 commits intoAzure-Samples:masterfrom
JLRishe wants to merge 2 commits intoAzure-Samples:masterfrom
Conversation
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.
|
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! |
ProxyTech
approved these changes
Nov 24, 2020
|
Please merge the pull request. Cx met the issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
signaturevariable inGetAuthorizationHeader()- 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 thesignaturevariable on line 60.