Fix incorrect lowercasing in GetCanonicalizedResource #12
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
signature
variable 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 thesignature
variable on line 60.