cloudflare / cloudflare/pingora

Finishing TODO in pingora-header-serde for checking if path is a file + avoiding panics

Open
#925 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
27.4k
Forks
1.7k
Avg merge
6h 22m
Merged PRs (30d)
3

Description

In
https://github.com/cloudflare/pingora/blob/e6e677fe9b58555140ab7bd14feff035392b3530/pingora-header-serde/src/dict.rs#L23-L30

The TODO can be easily completed and the return type can be changed to `Result, Error>` to account for invalid paths (and avoid panics on unwrap).

I will be making a PR soon after this issue is published - I made the minimum required changes and all the tests in the same [file](https://github.com/cloudflare/pingora/blob/main/pingora-header-serde/src/dict.rs) pass with `cargo test` from the subdirectory and `cargo test -p pingora-header-serde` from root.

Thanks!

Om

Contributor guide

Open the contributing guide

Research direction

Start at pingora-header-serde/src/dict.rs lines 23-30 and read the TODO and nearby tests. Run cargo test from that subdirectory and cargo test -p pingora-header-serde from the repository root; done means invalid paths are handled through the Result return type without panics and the existing tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.