Skip to content

Link Header pagination fails when there's no space between ';' and 'rel' #5667

@cruscio

Description

@cruscio

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

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

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions