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

IPFS Scheme Handler Routes "ipfs://<hash>" to "http://127.0.0.1:8081/<hash>/" while it should route to "http://<hash>.ipfs.localhost:8081/" #2728

Open
KillariDev opened this issue Jan 4, 2024 · 2 comments
Labels
exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors kind/discussion Topical discussion; usually not changes to codebase need/maintainers-input Needs input from the current maintainer(s) P3 Low: Not priority right now

Comments

@KillariDev
Copy link

  • OS: Windows
  • Version of IPFS Desktop 0.32.0

Describe the bug
IPFS Scheme Handler Routes "ipfs://" to "http://127.0.0.1:8081//" while it should route to "http://.ipfs.localhost:8081/"

To Reproduce

  1. Have Scheme handler installed with IPFS desktop
  2. Go to Eg, ipfs://bafybeia3ly2pwdukzwufnof3utydapssmf3eco6sciylew3vd5rg55uxji on Firefox
  3. Accept the dialog
  4. Observe firefox opening page http://127.0.0.1:8081/bafybeia3ly2pwdukzwufnof3utydapssmf3eco6sciylew3vd5rg55uxji/ while it should go to http://bafybeia3ly2pwdukzwufnof3utydapssmf3eco6sciylew3vd5rg55uxji.ipfs.localhost:8081/ instead
@KillariDev KillariDev added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Jan 4, 2024
Copy link

welcome bot commented Jan 4, 2024

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@whizzzkid
Copy link
Contributor

Thanks for submitting this issue @KillariDev, I see what you mean and I am not sure if this is a bug. This redirect happens based on this blob of code: https://github.com/ipfs/ipfs-desktop/blob/main/src/protocol-handlers.js#L19-L21. This ipfsd.gatewayAddr is the gateway multiaddr, which is /ip4/127.0.0.1/tcp/8081 in your case and the redirect happens as expected. However, this is not what you expected and that is understandable.

This behaviour is corrected by ipfs-companion which as the name suggests is a companion to ipfs implementations like kubo (that's what ipfs-desktop runs too). I didn't even notice this at first because I had the companion enabled.

However, I think this could be an additional feature, which allows overriding the gateway address to a custom address (localhost or a domain).

@whizzzkid whizzzkid added kind/discussion Topical discussion; usually not changes to codebase P3 Low: Not priority right now good first issue Good issue for new contributors need/maintainers-input Needs input from the current maintainer(s) exp/beginner Can be confidently tackled by newcomers and removed kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors kind/discussion Topical discussion; usually not changes to codebase need/maintainers-input Needs input from the current maintainer(s) P3 Low: Not priority right now
Projects
No open projects
Status: Needs Grooming
Development

No branches or pull requests

2 participants