Skip to content

RelationLink dictionary keys should be case-insensitive #6146

Closed

Description

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

Activity

  1. changed the title [-]RelationLink dictionary keyd should be case insensitive[/-] [+]RelationLink dictionary keys should be case insensitive[/+] on Feb 12, 2018
  2. changed the title [-]RelationLink dictionary keys should be case insensitive[/-] [+]RelationLink dictionary keys should be case-insensitive[/+] on Feb 12, 2018
  3. iSazonov commented on Feb 12, 2018

    @iSazonov
    Collaborator

    Confirm. The standard and previous say "MUST be case-insensitive". Need fix.

  4. markekraus commented on Feb 12, 2018

    @markekraus
    ContributorAuthor

    I updated the issue language to be more in line with the RFC language. I was using "should" where I should have been using "must".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions