Add `Authorization::<Bearer>::as_str` to get full value of an auth header

Open Beginner friendly
#208 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
api

Research direction

Start by locating the Authorization Bearer implementation and its existing tests. Add the requested as_str API so callers can obtain the complete Bearer authorization value without constructing it themselves, then add or update tests covering the returned value.

Written by the indexing model from the issue text.

Description

This API would be useful when full value of the header is needed (to log it somewhere, for example). Currently, there's only Authorization::<Bearer>::token which doesn't specify that the token is Bearer.

Sure, this is easy to do by concating "Bearer " to the token, but that requires an unnecessary allocation.

Dominant language
Rust
Stars
200
Forks
107
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hyperium/headers

All issues in hyperium/headers

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.