codeant-ai-for-open-source[bot] commented on PR #40120: URL: https://github.com/apache/superset/pull/40120#issuecomment-4451689597
Question: PATH_INFO` is already the path relative to the mount point (the `SCRIPT_NAME` prefix is stripped by the server/dispatcher before the app sees it). Flask routes using `PATH_INFO`, so this middleware would receive the same value Flask does, and the regex is already correct. Answer: Yes — that’s generally correct. `PATH_INFO` is the portion of the URL path presented to the WSGI app after `SCRIPT_NAME` has been removed, so if the request reaches this middleware in normal WSGI flow, it should see the same path Flask routes on. In that sense, the regex against `^/api/v1/extensions/...` is appropriate. One small caveat: this assumes the middleware is mounted in the same WSGI stack Flask receives, and that no upstream middleware rewrites `PATH_INFO` unexpectedly. But for the Superset setup shown here, the current approach looks sound. -- 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]
