Skip to content

Commit

Permalink
Fix encoding problem. (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunzhangMS authored and knithinc committed Jan 25, 2019
1 parent c1b38dc commit b5cfdd8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Syndication/AzureStack.MarketplaceSyndication.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,10 @@ function InvokeWebRequest {

while (-not $completed) {
try {
[void]($response = Invoke-WebRequest -Method $Method -Uri $Uri -ContentType "application/json" -Headers $Headers -Body $content -ErrorAction Stop)
if ($content -ne $null) {
$content = [System.Text.Encoding]::UTF8.GetBytes($content)
}
[void]($response = Invoke-WebRequest -Method $Method -Uri $Uri -ContentType "application/json; charset=utf-8" -Headers $Headers -Body $content -ErrorAction Stop)
$retryCount = 0
Ensure-SuccessStatusCode -StatusCode $response.StatusCode
$completed = $true
Expand Down

0 comments on commit b5cfdd8

Please sign in to comment.