Skip to content

fix: loading the json file did create a root application instead returning the cached json#190

Merged
maurerle merged 1 commit intomainfrom
do_not_handle_json_as_root
Jul 26, 2025
Merged

fix: loading the json file did create a root application instead returning the cached json#190
maurerle merged 1 commit intomainfrom
do_not_handle_json_as_root

Conversation

@maurerle
Copy link
Member

@maurerle maurerle commented Jul 26, 2025

Description

This fixes the PWA to not return the application on *.json files.

Motivation and Context

The issue appears when visiting the config.json of any meshviewer.
Using curl/wget, one receives the valid json, but in a browser with Service-Worker, the application is returned instead.
This is fixed with this config change.

Besides of the config.json, there is also the locale/en.json and thelike, which should not be handled by the service worker as well.
Instead, they are now correctly served by the browser cache.

How Has This Been Tested?

visit /config.json after visiting the application in a private tab.
Before, this did show the meshviewer as well.

Run npm run build and python -m http.server 8089 -d build to serve this, as the dev server does not have this issue.

Screenshots/links:

Checklist:

  • My code follows the code style of this project. (CI will test it anyway and also needs approval)
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Copy link

@AiyionPrime AiyionPrime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just tested, works as expected.

@maurerle maurerle merged commit dad6f2a into main Jul 26, 2025
2 checks passed
@maurerle maurerle deleted the do_not_handle_json_as_root branch July 26, 2025 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants