Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up pull request of #70, since the underlying issue has not been fixed with the release of version 1.4.3.
Two problems are fixed with this PR:
1.) Even with version 1.4.3 the index page is not able to load additional JavaScript modules. I see the following errors in the developer console:
This originates from Vite, which assumes that all generated paths should originate from the root
/(see vitejs/vite#13910).I was able to fix that behaviour by adding a relative base path
./to the Vite configuration.2.) Once the Vite paths have been fixed, the webapp would try to access the API from the root (e.g.
https://example.com/api/), even though the page was loaded from a path (e.g.https://example.com/dmarc/).Since version 1.4.0(?) this can be fixed, by changing the API path in the configuration dialog. However, the loading of the webapp will fail in the first place, which is a bad user-experience.
This PR fixes this problem by adding
window.location.pathnameto the default API path, which is used, if no explicit path has been set via the configuration dialog. This way the app loads without any problems - even form a path and with no extra configuration.