aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.67k stars 1.01k forks source link

Default value for current_request attribute is missed #1987

Open NastHoloviz opened 2 years ago

NastHoloviz commented 2 years ago

Hey everyone!

I believe that while the team worked on adding type definitions in app.py file they missed default value for current_request attribute in Chalice class. You can find this change here. By default this value was None. And after this change different issues are faced, e.g. in our case these were issues with authorizers for endpoints - endpoint started return 500 errors instead of 403.

Setting default parameter as None will fix the issues related to this attribute:

current_request: Optional[Request] = None

Could somebody from the team to take a look at this?

Regards, Anastasiia

hannes-ucsc commented 2 years ago

Same for the lambda_context attribute. Was this intentional?