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 backwards compatibility option to libp2phttp for the well-known resource #2798

Merged
merged 1 commit into from
May 17, 2024

Conversation

MarcoPolo
Copy link
Contributor

We've bike shedded on the well-known resource so long that we have a number of users that are relying on the old well-known path being at .well-known/libp2p. This patch gives them a migration path. Enabling this option allows clients to request both the new and old path in parallel (so it doesn't cost one whole round trip). On the server side, it serves both well-known resources so that legacy clients don't break.

This change is meant to give our early adopters of libp2phttp a migration path. The goal is to get rid of this code after some time (2 releases? 3?) to allow users to upgrade.

@MarcoPolo MarcoPolo requested a review from sukunrt May 17, 2024 00:11
This was referenced May 17, 2024
@MarcoPolo MarcoPolo force-pushed the marco/backwards-compat-libp2p-http-well-known branch from eddd9f7 to b105c1a Compare May 17, 2024 05:25
Comment on lines +38 to +42

// LegacyWellKnownProtocols refer to a the well-known resource used in an early
// draft of the libp2p+http spec. Some users have deployed this, and need backwards compatibility.
// Hopefully we can phase this out in the future. Context: https://github.com/libp2p/go-libp2p/pull/2797
const LegacyWellKnownProtocols = "/.well-known/libp2p"
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to export this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so. For similar reasons as we export the other one. Also when we remove compatibility support we’ll remove this, which could help folks realize this is gone.

@MarcoPolo MarcoPolo merged commit 024293c into master May 17, 2024
11 checks passed
@MarcoPolo MarcoPolo deleted the marco/backwards-compat-libp2p-http-well-known branch May 17, 2024 15:22
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.

None yet

3 participants