Skip to content

Commit f6dd979

Browse files
rustyconoverclaude
andcommitted
Expose X-VGI-Content-Encoding in CORS headers (v0.6.3)
Add X-VGI-Content-Encoding to the always-exposed CORS response headers so browser clients can detect zstd-compressed responses cross-origin. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 25ef386 commit f6dd979

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "vgi-rpc"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
description = "Vector Gateway Interface - RPC framework based on Apache Arrow"
55
readme = "README.md"
66
requires-python = ">=3.13"

tests/test_http.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,15 +1114,16 @@ def test_cors_specific_origin(self) -> None:
11141114
resp = tc.simulate_options("/add", headers={"Origin": "http://example.com"})
11151115
assert resp.headers.get("access-control-allow-origin") == "http://example.com"
11161116

1117-
def test_cors_exposes_www_authenticate_and_request_id(self) -> None:
1118-
"""CORS always exposes WWW-Authenticate and X-Request-ID headers."""
1117+
def test_cors_exposes_standard_headers(self) -> None:
1118+
"""CORS always exposes WWW-Authenticate, X-Request-ID, and X-VGI-Content-Encoding."""
11191119
server = RpcServer(RpcFixtureService, RpcFixtureServiceImpl())
11201120
app = make_wsgi_app(server, signing_key=b"test", cors_origins="*")
11211121
tc = falcon.testing.TestClient(app)
11221122
resp = tc.simulate_options("/add", headers={"Origin": "http://example.com"})
11231123
expose = resp.headers.get("access-control-expose-headers", "")
11241124
assert "WWW-Authenticate" in expose
11251125
assert "X-Request-ID" in expose
1126+
assert "X-VGI-Content-Encoding" in expose
11261127

11271128
def test_no_cors_by_default(self) -> None:
11281129
"""Without cors_origins, no CORS headers are added."""

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vgi_rpc/http/_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2134,7 +2134,7 @@ def make_wsgi_app(
21342134

21352135
# Always expose auth and request-id headers; capability headers are
21362136
# appended conditionally below.
2137-
cors_expose: list[str] = ["WWW-Authenticate", _REQUEST_ID_HEADER]
2137+
cors_expose: list[str] = ["WWW-Authenticate", _REQUEST_ID_HEADER, "X-VGI-Content-Encoding"]
21382138

21392139
# Build capability headers
21402140
capability_headers: dict[str, str] = {}

0 commit comments

Comments
 (0)