bito-code-review[bot] commented on PR #40120:
URL: https://github.com/apache/superset/pull/40120#issuecomment-4451544122
<!-- Bito Reply -->
The flagged issue is correct: the middleware matches PATH_INFO against a
hard-coded regex but doesn't account for app root prefixes in deployments using
APPLICATION_ROOT/SUPERSET_APP_ROOT. To resolve, normalize the path by stripping
the SCRIPT_NAME prefix before matching. No other comments found in the PR.
**superset/extensions/middleware.py**
```
def __call__(
self, environ: dict[str, Any], start_response: Callable[..., Any]
) -> Iterator[bytes]:
path = environ.get("PATH_INFO", "")
script_name = environ.get("SCRIPT_NAME", "")
if script_name and path.startswith(script_name):
path = path[len(script_name):]
if not _EXTENSION_ASSET_RE.match(path):
return self.app(environ, start_response)
```
--
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]