-
Notifications
You must be signed in to change notification settings - Fork 2
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
implement support for _redirects file #4
Conversation
@bmann I started a branch for my 404 experiments -- most of this will be rebased or thrown away. I also created a wrapper repo where I plan to document stuff more plus add other files, etc. https://github.com/cbrake/ipfs-experiments I can move this to fission space if you'd rather. I don't have the re-direct working yet, but closer. |
Might be more useful to merge into a branch here rather than master, to make it easier to submit as an upstream PR? do you want @walkah to do a review? If you want some testing, I would need a binary and/or instructions on how to build and run locally. you can always use https://talk.fission.codes for documentation — whatever works for you. |
@bmann its currently set to merge to master here (vs upstream) -- purely for the convenience of seeing changes. Once I get something that may go upstream, I agree that should merge to another branch, or be another branch. Not ready for review yet, but will let you know when I am. |
@bmann function implemented to find _redirects file and print the contents. Possible next steps:
This is still experimental code and will be re-based/cleaned up (remove instrumentation, etc) after it is working. A question on processing redirects ... do redirects have priority over files that actually exist, or should we try to resolve the path first, and then load the redirects if it does not? (this determines where in code path redirect processing goes) |
using https://github.com/cbrake/ipfs-experiments/blob/main/_redirects, I get the following when running this code:
|
a26a704
to
3ed7796
Compare
basic support for a _redirects file with a simple matcher has been implemented. I've also rebased/squashed the commits to remove debug messages, so I think this is ready for basic testing. |
using test setup documented: https://github.com/cbrake/ipfs-experiments, the following redirects work when browsing test and hi: |
👋🏻 @cbrake. Thanks for getting this work started! Out of curiosity, are you still actively working on this issue? I'm starting to focus on this over here at Fission and would love to collaborate if you're up for it. I'm pretty new to IPFS so I'm trying to get up to speed first. Anyway, if by chance you were wanting to bounce ideas off another human feel free to reach out. 🙏🏻 |
@justincjohnson No, I'm not actively working on this. Let me know if you have any questions -- glad to share anything I know. My github notifications are pretty noisy, so feel free to email me directly if I don't respond here. |
TODO/Open:
_redirects
loading go -- before looking for files or after?_redirects
be somehow cached so we don't need to continually load it?