Skip to content
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

ContentType is missing in creation of signature #3

Open
ghost opened this issue Jun 17, 2020 · 0 comments
Open

ContentType is missing in creation of signature #3

ghost opened this issue Jun 17, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 17, 2020

Hi,

first very good module I learned a lot :)
Sadly during the creation of the singnature when using "Get-AzureBlobContainerBlobs" I found that the ContentType (application/octet-stream) was missing but send as header therefor the signatures differ. Because application/octet-stream is the default I created a workaround inside GetTokenStringToSign:

(...)
        if($RangeEnd -gt 0)
        {
            $Range="bytes=$($RangeStart)-$($RangeEnd-1)"
        }
+        if ($ContentType -eq "") {
+            $ContentType = "application/octet-stream"
+        }
        $SigningPieces=@(
            $Verb,$ContentEncoding,
            $ContentLanguage,$LengthString,
            $ContentMD5,$ContentType,$Date,$IfModifiedSince,$IfMatch,$IfNoneMatch,$IfUnmodifiedSince,$Range
        )
(...)

But maybe it is better to change $TokenParams and $RequestParams inside Get-AzureBlobContainerBlobs (and all the other where it is missing)

Kind regards,
Ralf

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

No branches or pull requests

0 participants