Skip to content

HeaderName constructors panic for names longer than 64KiB #432

@acfoltzer

Description

@acfoltzer

Attempting to create a HeaderName longer than 64KiB fails, but with a panic rather than an InvalidHeaderName error: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=f43aad9f01cc5c1bd05149129310c7e7

I think this should return Err(InvalidHeaderName) instead, but if there is good cause to keep it as a panic, that panic should be documented on the various constructors so it's less of a surprise.

If you agree about switching to the Err behavior, I'd be happy to put in a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions