Skip to content

Commit 8c8c9e4

Browse files
committed
guard against invalid 304 response
1 parent e92db94 commit 8c8c9e4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/edge_proxy/environments.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ async def _fetch_document(
173173
headers=headers,
174174
)
175175
if response.status_code == starlette.status.HTTP_304_NOT_MODIFIED:
176+
if not environment_document:
177+
# This is an API error and should never happen
178+
raise f"GET /environment-document returned 304 without a cached document. environment={key_pair.client_side_key}"
176179
return environment_document
177180
response.raise_for_status()
178181
return orjson.loads(response.text)

0 commit comments

Comments
 (0)