From 49e42faf9b7b3a383f6fb3f93f4919dc5788ddc1 Mon Sep 17 00:00:00 2001 From: Hardexit <112691363+Hardexit@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:17:42 +0200 Subject: [PATCH] fix missing Content-Type header --- Private/Invoke-AzureStorageBlobUploadFinalize.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Private/Invoke-AzureStorageBlobUploadFinalize.ps1 b/Private/Invoke-AzureStorageBlobUploadFinalize.ps1 index 13d47ba..3af77ea 100644 --- a/Private/Invoke-AzureStorageBlobUploadFinalize.ps1 +++ b/Private/Invoke-AzureStorageBlobUploadFinalize.ps1 @@ -33,11 +33,14 @@ function Invoke-AzureStorageBlobUploadFinalize { $XML += "$($Chunk)" } $XML += '' - + $Headers = @{ + "content-type" = "text/plain; charset=UTF-8" + } + try { - $WebResponse = Invoke-RestMethod -Uri $Uri -Method "Put" -Body $XML -ErrorAction Stop + $WebResponse = Invoke-RestMethod -Uri $Uri -Method "Put" -Body $XML -Headers $Headers -ErrorAction Stop } catch { Write-Warning -Message "Failed to finalize Azure Storage blob upload. Error message: $($_.Exception.Message)" } -} \ No newline at end of file +}