codeant-ai-for-open-source[bot] commented on code in PR #43169:
URL: https://github.com/apache/superset/pull/43169#discussion_r3785007524
##########
superset/app.py:
##########
@@ -242,4 +242,12 @@ def __call__(
environ["PATH_INFO"] = original_path_info[len(self.app_root) :]
environ["SCRIPT_NAME"] = self.app_root
return self.wsgi_app(environ, start_response)
+ if original_path_info == "/static" or
original_path_info.startswith("/static/"):
+ # Webpack bakes `/static/assets/` into the bundle as its
publicPath,
+ # so lazily loaded chunks and the assets they reference are always
+ # requested without the app-root prefix. Serve those unprefixed
+ # paths as-is instead of 404ing them; the app root is left off
+ # PATH_INFO and SCRIPT_NAME because the static route is registered
+ # at `/static/...` on the unprefixed app.
+ return self.wsgi_app(environ, start_response)
Review Comment:
**Suggestion:** The new branch only helps when `/static/...` reaches this
WSGI application, but the bundled nginx configuration has no root-level
`/static` location: it proxies only `${SUPERSET_APP_ROOT}/static` and
`${SUPERSET_APP_ROOT}`. With the documented Docker/nginx deployment and
`SUPERSET_APP_ROOT=/analytics`, webpack's unprefixed requests are handled by
nginx instead of reaching this branch and still fail before Superset can serve
them. Add a root-level static proxy in the supplied nginx configuration or
otherwise ensure that deployment forwards `/static` to the application. [api
mismatch]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Bundled nginx deployments still return 404 for unprefixed static assets.
- ❌ CSS and lazy-loaded JavaScript fail under non-root app roots.
- ⚠️ The middleware fix works only when `/static` reaches WSGI.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ac1f459fa0ba4a69b6afaceb5854d688&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=ac1f459fa0ba4a69b6afaceb5854d688&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/app.py
**Line:** 245:252
**Comment:**
*Api Mismatch: The new branch only helps when `/static/...` reaches
this WSGI application, but the bundled nginx configuration has no root-level
`/static` location: it proxies only `${SUPERSET_APP_ROOT}/static` and
`${SUPERSET_APP_ROOT}`. With the documented Docker/nginx deployment and
`SUPERSET_APP_ROOT=/analytics`, webpack's unprefixed requests are handled by
nginx instead of reaching this branch and still fail before Superset can serve
them. Add a root-level static proxy in the supplied nginx configuration or
otherwise ensure that deployment forwards `/static` to the application.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43169&comment_hash=43f2fde645bfb0d8f690109754295df707d1076121a5aedcf6730682ae42aa64&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43169&comment_hash=43f2fde645bfb0d8f690109754295df707d1076121a5aedcf6730682ae42aa64&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]