Hi Manu,
OpenCloning fetches at least two resources using absolute URL paths that break when the application is served behind a sub-path proxy:
axios.get("/config.json"): always resolves against the browser origin, not the OC base path
`/examples/${name}` (two occurrences): same issue for example cloning strategies
When OC is deployed behind JupyterHub, institutional reverse proxies, or our Reproducible Research Platform (RRP), the browser origin is the gateway (e.g. https://host:7443) rather than the OC backend port. A request to /config.json returns whatever the gateway serves at its root. In our case it is the RRP platform config, which has no backendUrl instead of OC's own config. The examples fetch similarly returns a platform HTML page instead of the JSON cloning strategy.
Proposed fix
Change both to relative paths in the source:
axios.get("/config.json") to axios.get("./config.json")
`/examples/${name}` to `examples/${name}` (remove leading slash)
Relative paths resolve from the page's base URL, which is the OC application root regardless of the proxy prefix. This is a two-line change in the source and requires no configuration.
Context
I encountered this while deploying OC with an openBIS adapter on RRP (see issue #667 for the broader generic backend discussion) to use openBIS instead of eLabFTW as the the research data management system / ELN-LIMS. The current workaround requires patching the built JavaScript at deploy time, which is fragile and build-version-specific. A source-level fix would benefit any non-localhost deployment.
Hi Manu,
OpenCloning fetches at least two resources using absolute URL paths that break when the application is served behind a sub-path proxy:
axios.get("/config.json"): always resolves against the browser origin, not the OC base path`/examples/${name}`(two occurrences): same issue for example cloning strategiesWhen OC is deployed behind JupyterHub, institutional reverse proxies, or our Reproducible Research Platform (RRP), the browser origin is the gateway (e.g.
https://host:7443) rather than the OC backend port. A request to/config.jsonreturns whatever the gateway serves at its root. In our case it is the RRP platform config, which has nobackendUrlinstead of OC's own config. The examples fetch similarly returns a platform HTML page instead of the JSON cloning strategy.Proposed fix
Change both to relative paths in the source:
axios.get("/config.json")toaxios.get("./config.json")`/examples/${name}`to`examples/${name}`(remove leading slash)Relative paths resolve from the page's base URL, which is the OC application root regardless of the proxy prefix. This is a two-line change in the source and requires no configuration.
Context
I encountered this while deploying OC with an openBIS adapter on RRP (see issue #667 for the broader generic backend discussion) to use openBIS instead of eLabFTW as the the research data management system / ELN-LIMS. The current workaround requires patching the built JavaScript at deploy time, which is fragile and build-version-specific. A source-level fix would benefit any non-localhost deployment.