Skip to content

RelationLink dictionary keys should be case-insensitive #6146

@markekraus

Description

@markekraus

Per RFC 8288, relation types on Link response headers MUST be compared in a case-insensitive fashion. HTTP servers SHOULD send relation types as all lower case, but parsing them MUST be case-insensitive.

Currently, the RelationLink dictionary we create is case sensitive. This should be change to case-insensitive, An HTTP server sending more than one of the same relation type (case-insensitive) is not RFC compliant, therefore a case-insensitive dictionary should not encounter keys of the same characters with different casing.

Steps to reproduce

$uri = 'https://api.github.com/repositories/49609581/issues?page=2'
$response = Invoke-WebRequest -Uri $Uri
$response.RelationLink.next -eq 'https://api.github.com/repositories/49609581/issues?page=3'
$response.RelationLink.Next -eq 'https://api.github.com/repositories/49609581/issues?page=3'

Expected behavior

True
True

Actual behavior

True
False

Environment data

Name                           Value
----                           -----
PSVersion                      6.0.1
PSEdition                      Core
GitCommitId                    v6.0.1
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-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