You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent behavior from Invoke-RestMethod from Windows Powershell to Powershell Core #6002
changed the title [-]Inconsistent behavior from Invoke-RestMethod from Powershell to Powershell in Linux[/-][+]Inconsistent behavior from Invoke-RestMethod from Windows Powershell to Powershell Core[/+]on Jan 24, 2018
Strict header validation is now default in PS core. This applies to any RFC defined header supplied to -Headers or -ContentType. One can bypass strict header validation with the -SkipHeaderValidation parameter.
Actually... there seems to be some odd behavior here. -SkipHeaderValidation doesn't seem to work when -InFile is used. This is a bug. I'll have to look into it.
After investigating, -SkipHeaderValidation is not being applied at all to -ContentType. I should have a PR to fix this tomorrow or later today. I have the fix code, just need to write tests.
Activity
[-]Inconsistent behavior from Invoke-RestMethod from Powershell to Powershell in Linux[/-][+]Inconsistent behavior from Invoke-RestMethod from Windows Powershell to Powershell Core[/+]SteveL-MSFT commentedon Jan 24, 2018
As far as I can tell, a mimetype consists of a type/subtype. Seems like we have 3 options here:
cc Mark Kraus (@markekraus)
markekraus commentedon Jan 24, 2018
Strict header validation is now default in PS core. This applies to any RFC defined header supplied to
-Headersor-ContentType. One can bypass strict header validation with the-SkipHeaderValidationparameter.https://github.com/PowerShell/PowerShell/blob/master/docs/BREAKINGCHANGES.md#changes-to-web-cmdlets
More info https://get-powershellblog.blogspot.com/2017/11/powershell-core-web-cmdlets-in-depth.html#L08
markekraus commentedon Jan 24, 2018
Actually... there seems to be some odd behavior here. -SkipHeaderValidation doesn't seem to work when
-InFileis used. This is a bug. I'll have to look into it.markekraus commentedon Jan 24, 2018
After investigating,
-SkipHeaderValidationis not being applied at all to-ContentType. I should have a PR to fix this tomorrow or later today. I have the fix code, just need to write tests.