Add redirect support (limit: 6)
Resolves issue #25.
@RangerMauve Why don't I add you to the npm package owners?
@pfrazee That'd be swell. 💜
Could be useful to be added as a collaborator on the repo too. 😁
Sure thing! What's your npm username?
Also rangermauve 😁
Done!
The test relies on @staltz not changing his website. He hasn't done so in months even after the problem was identified in #25, so I hope it will work for some time.
Ideally, all these tests should be hosted on a project controlled domain. Come to think of it, does any of you have access to set up a redirect from the old datproject.org/.well-known/dat to dat.foundation/.well-known/dat? That could serve as the test case.
I've got access to our netlify and DNS stuff and could set that up. I think datproject.org and dat.foundation are both hosted from the same server so they'd have the same .well-known folder.
I can set up another domain which does the redirect if you'd like. Same with DNS redirects.
What should it contain?
Something like redirect1.dat.foundation => .well-known redirect to dat.foundation and redirect2.dat.foundation => DNS redirect to dat.foundation?
@RangerMauve https://datproject.org/.well-known/dat currently redirects to https://dat.foundation/. Fix that redirect to point to the existing https://dat.foundation/.well-known/dat, and we can use https://datproject.org/.well-known/dat for the test. (Assuming those domains and redirects are expected to remain operational for a few years.)
Interesting, a test case relying on my laziness to update my website! :)
Granted, I think netlify (my host) will change how redirects work. See this email I got:
We’ve recently fixed a bug in Netlify’s redirect handling, and we’ve identified one or more redirect rules on staltz.com that will begin to behave differently after the bug fix is applied on April 7th.
For more information on the nature of the bug and how it affects redirect rules, please visit the Community topic on our fix for forced redirects and shadowing behavior.
The redirect rules listed below are currently behaving as forced redirects (redirecting past existing content), even though you haven’t explicitly configured them to do so. You may want to check each redirect to be sure you want to continue this behavior, and if so, explicitly mark the rule as forced. In a _redirects file, you can do this by adding ! to the redirect status code. In a netlify.toml file, add the key and value force=true.
The following redirect rules might be affected by this change:
/.well-known/dat ... /dat 301 .../xstream ... http://staltz.github.io/xstream/ 301 ...
Err, I don't think I'll have time for setting up the domains after all, but I can still merge this in if it's looking good to you @da2x. I've just got way too much on my plate right now. 😅