-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Milestone
Description
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
Line 835 in 9e99d59
| string pattern = "<(?<url>.*?)>;\\srel=\"(?<rel>.*?)\""; |
Test
PowerShell/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
Line 797 in 9e99d59
| 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
- Current regex not working: https://regex101.com/r/QbglHf/1
- Proposed modification: https://regex101.com/r/QbglHf/2
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module