If links in a Link header do not contain a space between ; and rel then invoke-webrequest fails to populate the RelationLink property
<http://localhost:8080/PowerShell?test=linkheader&maxlinks=5&linknumber=1>; rel="self"
<http://localhost:8080/PowerShell?test=linkheader&maxlinks=5&linknumber=1>;rel="self"
Not having a space is valid (more appropriate, even) per the specification: https://tools.ietf.org/html/rfc5988 page 6
For reference
#5265 [Feature] Add Multiple Link Header Support
Code
|
string pattern = "<(?<url>.*?)>;\\srel=\"(?<rel>.*?)\""; |
Test
|
It "Validate Invoke-WebRequest returns valid RelationLink property with absolute uris if Link Header is present" { |
I think the appropriate fix would be to change \\s to \\s* to allow for 0 or more whitespace rather than requiring a single whitespace
If links in a Link header do not contain a space between
;andrelthen invoke-webrequest fails to populate the RelationLink propertyNot having a space is valid (more appropriate, even) per the specification: https://tools.ietf.org/html/rfc5988 page 6
For reference
#5265 [Feature] Add Multiple Link Header Support
Code
PowerShell/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs
Line 835 in 9e99d59
Test
PowerShell/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
Line 797 in 9e99d59
I think the appropriate fix would be to change
\\sto\\s*to allow for 0 or more whitespace rather than requiring a single whitespace