rusackas commented on code in PR #40084:
URL: https://github.com/apache/superset/pull/40084#discussion_r3533529288
##########
tests/unit_tests/extensions/test_cache_middleware.py:
##########
@@ -64,6 +64,21 @@ def test_asset_path_is_intercepted() -> None:
assert "Cookie" not in vary
+def test_nested_asset_path_is_intercepted() -> None:
+ headers = call_middleware(
+ "/api/v1/extensions/acme/my-ext/workers/nested/chunk.wasm",
+ [("Vary", "Accept-Encoding, Cookie")],
+ )
Review Comment:
Added type hints for these—good catch.
##########
tests/unit_tests/extensions/test_cache_middleware.py:
##########
@@ -64,6 +64,21 @@ def test_asset_path_is_intercepted() -> None:
assert "Cookie" not in vary
+def test_nested_asset_path_is_intercepted() -> None:
+ headers = call_middleware(
+ "/api/v1/extensions/acme/my-ext/workers/nested/chunk.wasm",
+ [("Vary", "Accept-Encoding, Cookie")],
+ )
+ vary = dict(headers).get("Vary", "")
Review Comment:
Fixed, `vary` is now typed.
##########
tests/unit_tests/extensions/test_cache_middleware.py:
##########
@@ -64,6 +64,21 @@ def test_asset_path_is_intercepted() -> None:
assert "Cookie" not in vary
+def test_nested_asset_path_is_intercepted() -> None:
+ headers = call_middleware(
+ "/api/v1/extensions/acme/my-ext/workers/nested/chunk.wasm",
+ [("Vary", "Accept-Encoding, Cookie")],
+ )
+ vary = dict(headers).get("Vary", "")
+ assert "Cookie" not in vary
+
+
+def test_get_endpoint_with_trailing_slash_is_not_intercepted() -> None:
+ upstream = [("Vary", "Accept-Encoding, Cookie")]
Review Comment:
Fixed too, annotated with `ResponseHeaders`.
--
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]