Skip to content

Commit d1a81af

Browse files
Fix unexpected bugs in v3
1 parent e6c2108 commit d1a81af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/event_handler_rest/src/accessing_request_details_headers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def get_todos():
1717
endpoint = "https://jsonplaceholder.typicode.com/todos"
1818

19-
api_key = app.current_event.headers["X-Api-Key"]
19+
api_key = app.current_event.headers.get("X-Api-Key")
2020
todos: Response = requests.get(endpoint, headers={"X-Api-Key": api_key})
2121
todos.raise_for_status()
2222

0 commit comments

Comments
 (0)