Skip to content

HttpClient: Consider removing MailAddressParser #52664

Closed
@geoffkizer

Description

@geoffkizer

This parser is used for the From header, which is an uncommon HTTP header.

This class contains a lot of complicated logic, and contributes in a nontrivial way to Blazor assembly size. See discussion here: #44534 (comment)

Unlike most parsers, this parser does not produce a strongly-typed value -- it just validates the mail address and returns it as a string.

We should consider just removing this entirely. This would help Blazor assembly size, and keep consistency between full framework and Blazor.

The impact of removing this would be that From header values that were previously considered invalid, and thus were either discarded or caused exceptions, would now be considered valid. Given that the From header is not commonly used, and only error cases are affected, I don't think this is a problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Net.HttpenhancementProduct code improvement that does NOT require public API changes/additionssize-reductionIssues impacting final app size primary for size sensitive workloads

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions