mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-02 14:35:14 -05:00
This pops up every now and then and I could never figure it out. A user figured it out in #6936. The cause is appending a query string to the app URL. For example: ```sh http://127.0.0.1:9090/?__theme=dark ``` The query string breaking the static file serving, which prevents our translations from loading correctly. Instead of the JSON translations, FastAPI sends the index HTML page. The UI then errors when attempting to parse the translation JSON. The query string ?__theme=dark is used by Gradio to force dark mode. I believe the users with this issue are doing the same thing the user in #6936 did (just change the port number on an existing bookmark) or their browser history/bookmark includes the query string. Though this is technically a user-caused problem (we cannot prevent the user from using a malformed URL), we can work around it. When query string is used on the root path, we can redirect the browser to the root path without the query string. This is done via very simple middleware. Closes #6696 Closes #6817 Closes #6828 Closes #6936 Closes #6983
8.3 KiB
8.3 KiB