From 3d317540746fd31fa5508e5b3dc033d6af5d0916 Mon Sep 17 00:00:00 2001 From: Gordon Leigh Date: Tue, 15 Oct 2019 16:35:20 +0100 Subject: [PATCH] fix: options endpoint does not invoke lambda (#1434) --- samcli/local/apigw/local_apigw_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samcli/local/apigw/local_apigw_service.py b/samcli/local/apigw/local_apigw_service.py index e11191ec31..561c9016f9 100644 --- a/samcli/local/apigw/local_apigw_service.py +++ b/samcli/local/apigw/local_apigw_service.py @@ -173,7 +173,7 @@ def _request_handler(self, **kwargs): cors_headers = Cors.cors_to_headers(self.api.cors) method, _ = self.get_request_methods_endpoints(request) - if method == "OPTIONS": + if method == "OPTIONS" and method not in route.methods: headers = Headers(cors_headers) return self.service_response("", headers, 200)