Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Incorrect routing when using a nested URL with routePrefix #17

Open
backcopy opened this issue Dec 3, 2018 · 0 comments
Open

Incorrect routing when using a nested URL with routePrefix #17

backcopy opened this issue Dec 3, 2018 · 0 comments

Comments

@backcopy
Copy link

backcopy commented Dec 3, 2018

When setting a nested URL through another web server (per best practice) litecore node is incorrectly setting the route URL as root while building the route prefix, see below:

https://github.com/litecoin-project/litecore-node/blob/be0cd40ef806dfdf020d2918e3fab80f022e135b/lib/services/web.js#L106

This will break any complex setup where a reverse proxy or firewall is set infront of litecore node.

The patch should take into account the possibility of a nested URL when building the prefix. I don't have a PR for this right now but a rough hot patch for existing services would look something like:

this.app.use('/deep/nested/' + this.node.services[key].getRoutePrefix(), subApp); 
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant