Skip to content

Fix aws-sigv4 canonical request formatting fallibility #711

@jdisanti

Description

@jdisanti

The aws-sigv4 crate currently implements the Display trait for formatting the canonical request, and since it's using ToString to do the actual formatting, it will panic if there's any error during that formatting.

In #710, we fixed a bug where header values that contained non-ASCII characters would cause a panic, but the problem was just punted a little bit since now it can panic if there's invalid UTF-8 in the header value.

Options we should evaluate and choose from:

  1. Refactor CanonicalRequest to have a fallible format function instead of implementing Display, and bubble the error up.
  2. Refactor CanonicalRequest to have an infallible format function, but produce bytes instead of a string, and put the header value's bytes directly into the formatted canonical request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions