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

Handle IPNS names without dots #23

Merged
merged 1 commit into from
Oct 20, 2023
Merged

Handle IPNS names without dots #23

merged 1 commit into from
Oct 20, 2023

Conversation

hsanjuan
Copy link
Collaborator

When checking if an ipfs name is blocked, we may get an /ipns/{dnslink_name} where the {dnslink_name} has been encoded according to

https://specs.ipfs.tech/http-gateways/subdomain-gateway/#host-request-header

That is, "." has been replaced with "-" and "-" has been replaced with "--".

Because of this, when the given dns name has no dots, we undo things are replace "--" with "-" and "-" with ".".

@hsanjuan hsanjuan self-assigned this Oct 18, 2023
When checking if an ipfs name is blocked, we may get an
`/ipns/{dnslink_name}` where the `{dnslink_name}` has been
encoded according to

https://specs.ipfs.tech/http-gateways/subdomain-gateway/#host-request-header

That is, "." has been replaced with "-" and "-" has been replaced with "--".

Because of this, when the given dns name has no dots, we undo things are
replace "--" with "-" and "-" with ".".
@hsanjuan
Copy link
Collaborator Author

This is manually proven to work as expected now.

@hsanjuan hsanjuan merged commit f840213 into master Oct 20, 2023
8 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.

1 participant