Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for http-path #246

Merged
merged 2 commits into from
Jun 13, 2024
Merged

Add support for http-path #246

merged 2 commits into from
Jun 13, 2024

Conversation

MarcoPolo
Copy link
Contributor

@MarcoPolo MarcoPolo requested a review from sukunrt June 5, 2024 16:48
Copy link
Member

@sukunrt sukunrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a few examples to the fuzzer here:

var good = []string{

multiaddr_test.go Show resolved Hide resolved
multiaddr_test.go Outdated Show resolved Hide resolved
@MarcoPolo
Copy link
Contributor Author

good call on the fuzzing. I found a surprising behavior where if a variable sized component has a zero-len value it will not put anything into the multiaddr string. This means that the string /http-path/http is ambigous since it's not clear if it's http-path with no value and an http component, or an http-path with the value "http".

To disambiguate, I've made it a requirement for there to be at least some value in the http-path component. Which seems to be the same thing that other length prefixed sized components do (e.g. dns, p2p). This library should probably make it possible to represent components with a value that has len 0 (e.g. /http-path//http), but nothing currently needs this, so likely not a priority.

@MarcoPolo MarcoPolo merged commit 7b6903f into master Jun 13, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants