Wrapping a call to Registry so that Invoke-WebRequest does not fail on non-text responses#2811
Wrapping a call to Registry so that Invoke-WebRequest does not fail on non-text responses#2811
Conversation
|
Hi @JonathanMalek, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
mirichmo
left a comment
There was a problem hiding this comment.
In general, we like/need/require tests for all code changes as a forcing function to increase test coverage. In this case, we have internal tests for Invoke-WebRequest that haven't yet been ported to run out of GitHub and you don't have access to them. The tests look like they cover this scenario, so requiring tests from you would be a needless duplication of effort.
| || CheckIsXml(contentType) | ||
| || CheckIsJson(contentType); | ||
|
|
||
| #if !CORECLR // Registry access not supported on CoreCLR |
There was a problem hiding this comment.
PowerShell Core on Windows uses the registry. Use Platform.IsWindows to make it a runtime check.
|
Thanks for the background @mirichmo. Changed to check for Platform.IsWindows instead. |
|
@JonathanMalek Thanks for your contribution |
A small bug where content types from an Invoke-WebRequest that are not text-based fall through to a registry check. Wrapping that check (which is additive) with a #if !CORECLR. I can't find any tests that test out that specific behavior, or I would be happy to extend them. I'm also happy to add a new test, just not sure if that is desired.