Skip to content

Commit c4d0fcf

Browse files
authored
fix(local): bad headers in infra (#12)
* fix(local): bad headers in infra * fix(tests): typo in test
1 parent 6e81ce6 commit c4d0fcf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

scaleway_functions_python/local/infra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def inject_ingress_headers(request: "Request", event: "Event") -> None:
2222
headers = {
2323
"Forwarded": f"for={request.remote_addr};proto=http",
2424
"X-Forwarded-For": request.remote_addr,
25-
"X-Envoy-External-Adrdress": request.remote_addr,
25+
"K-Proxy-Request": "activator",
2626
"X-Forwarded-Proto": "http",
2727
# In this context "X-Forwared-For" == "X-Envoy-External-Address"
2828
# this property doesn't hold for actual functions

tests/test_local/test_serving.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ def test_serve_handler_inject_infra_headers(client):
8383

8484
# Check the headers injected in the event object
8585
assert headers["Forwarded"] == "for=127.0.0.1;proto=http"
86+
assert headers["K-Proxy-Request"] == "activator"
8687
assert headers["X-Forwarded-For"] == "127.0.0.1"
87-
assert headers["X-Envoy-External-Adrdress"] == "127.0.0.1"
88+
assert headers["X-Envoy-External-Address"] == "127.0.0.1"
8889
assert headers["X-Forwarded-Proto"] == "http"
8990

9091
uuid.UUID(headers["X-Request-Id"])

0 commit comments

Comments
 (0)