This was a non-trivial effort in designing a dynamic regular expression generator based on origin and redirect URL patterns.
This makes the rules less greedy, https://host/<namespace>/.* instead of https://host/.*
The rules are also now dynamic https://<cid>.<namespace>.subdomain.host.tld/<path> can now map to http://localhost:8080/<namespace>/<cid>/<path> just based on regex rules redirect.
fixes: https://github.com/ipfs/ipfs-companion/issues/1254 closes: https://github.com/ipfs/ipfs-companion/issues/1253
Builds on work already in: #1236
In this PR:
https://host/<namespace>/.*
instead ofhttps://host/.*
https://<cid>.<namespace>.subdomain.host.tld/<path>
can now map tohttp://localhost:8080/<namespace>/<cid>/<path>
just based on regex rules redirect.Test Runs: https://github.com/ipfs/ipfs-companion/pull/1259 Follow up PR: https://github.com/ipfs/ipfs-companion/pull/1261