drawio icon indicating copy to clipboard operation
drawio copied to clipboard

`service-worker.js` requested from webroot `/` even though `DRAWIO_BASE_URL` contains path

Open osnard opened this issue 3 years ago • 1 comments

Preflight Checklist

  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe the bug If DrawIO is hosted in a subdirectory of the webroot, the "editor" tries lo load service-worker.js from / rather than from /<path> and fails with status 404.

To Reproduce Steps to reproduce the behavior:

  1. Configure DRAWIO_BASE_URL as https://server/drawio/
  2. Run application on https://127.0.0.1:8080/
  3. Setup ReverseProxy (e.g. via Apacher Webserver), that forwards https://server/drawio/ to https://127.0.0.1:8080/
  4. Use https://server/drawio/ in an IFRAME embedding scenario

Expected behavior DarwIO application can be loaded properly in the same way as id the IFAME would embed the diagrams.net endpoint

Screenshots If applicable, add screenshots to help explain your problem.

  • draw.io version 17.1.3

image image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version 99

Smartphone (please complete the following information): N/A

Additional context Issue occurs when embedding a self hosted DrawIO application using an IFRAME

osnard avatar Apr 07 '22 13:04 osnard

We are also running into this issue. When trying to run Draw.io as a subpath to a gitlab installation in kubernetes, some of the static assets are being sent to webroot instead of https://gitlab.domain.com/-/draw/

This is the case for the gitlab OIDC integration as well, when trying to create a new diagram it will call webroot/gitlab instead of webroot/-/drawio/gitlab

MichaelGerhart avatar Aug 02 '22 16:08 MichaelGerhart

Thanks for the report. This will be fixed in the next release.

alderg avatar Aug 21 '22 16:08 alderg