Skip to content

HttpClientHint string properties are quoted #14

Closed

Description

@MarlonTuckerAareon

Hello

It appears that all / most string properties inside the HttpClintHint structure are quoted? Is this by design or is this a bug?

I'm testing with Chrome version 138.0.7204.97

Forgive the screenshot of a property window but it was the quickest way for me to show an example:

Image

Activity

  1. BenjaminAbt commented on Nov 21, 2026

    @BenjaminAbt
    Member

    Thanks for the report, and sorry for the late reply.

    The quotes are by design on the HTTP side: browsers send Sec-CH-UA-Platform, Sec-CH-UA-Platform-Version, Sec-CH-UA-Arch, and Sec-CH-UA-Model as HTTP Structured Field strings (RFC 9651), so the header value itself is "Windows", including the quotes. Platform, PlatformVersion, Architecture, and Model return the header values as sent, and they keep doing so to avoid breaking existing code.

    Version 3.2.5 adds decoded properties to HttpClientHints and HttpClientHintsView (#20):

    HttpClientHints hints = httpContext.GetClientHints();
    string? platform = hints.Platform;               // "Windows", with quotes
    string? decodedPlatform = hints.DecodedPlatform; // Windows
    
    Property Decoded property
    Platform DecodedPlatform
    PlatformVersion DecodedPlatformVersion
    Architecture DecodedArchitecture
    Model DecodedModel

    For other headers of this type, such as Sec-CH-UA-Bitness, use HttpClientHintsInterpreter.DecodeStructuredString. A malformed quoted value decodes to null.

    UA and FullVersionList are different: their headers are lists of brands with versions, such as "Chromium";v="138", "Google Chrome";v="138", so the quotes are part of the list syntax. These two properties still return the serialized list.

    The README section Decoded values has the details. I'm closing this issue; feel free to reopen it if something doesn't work as expected.

  2. added
    documentation
    question
    on Nov 22, 2026
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

    documentationquestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions