GoogleCloudPlatform / google-cloud-powershell

PowerShell cmdlets for the Google Cloud Platform
http://googlecloudplatform.github.io/google-cloud-powershell/
Apache License 2.0
135 stars 61 forks source link

Content-Encoding gzip error #626

Closed justlearntutors closed 5 years ago

justlearntutors commented 5 years ago

Here is my command for Powershell

New-GcsObject -Bucket ssl-images-justlearn -ContentType application/javascript -ObjectName $JsStr -Metadata @{ "Content-Encoding" = "gzip"} -File C:\Users\Philip\source\repos\Justlearn\Justlearn\wwwroot\script.min.js.gz -Force

I want to add gzip for Content-Type

The result is shown here. https://imgur.com/a/7mtfvtw

How can I solve?

Content-Type gzip is added in the wrong place.

quoctruong commented 5 years ago

@justlearntutors I don't think Content-Type can be gzip (gzip is Content-Encoding, not the underlying content type). You can read more about that under the Content-Encoding section here.

justlearntutors commented 5 years ago

How can I add Content-Encoding in the right place?

-Metadata @{ "Content-Encoding" = "anything"}

See image. Image of Cloud

quoctruong commented 5 years ago

@justlearntutors I did some investigation and turns out this is a bug in the cmdlet. We will fix this in the next release. Thanks for finding this out!