Skip to content

fix: Options requests not invoking Local Lambda - #468

Merged
sanathkr merged 2 commits into
aws:developfrom
jfuss:turn-off-flask-automatic-options
Jun 8, 2018
Merged

sanathkr merged 2 commits into
aws:developfrom
jfuss:turn-off-flask-automatic-options

Conversation

@jfuss

@jfuss jfuss commented Jun 7, 2018

Copy link
Copy Markdown
Contributor

Flask will automagically add a OPTIONS to a route if OPTIONS is not provided
in the list of HTTP Verbs on a url rule. Since we add a new url rule for each
path + HTTP Verb, Flask was adding OPTIONS to every path. This causes some
paths to not execute the Local Lambda code when calling a path with an OPTIONS
verb. We turn off this behavior by turning off the feature through provide_automatic_options.

Issue #, if available:
#400

Description of changes:
See above commit message

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Flask will automagically add a OPTIONS to a route if OPTIONS is not provided
in the list of HTTP Verbs on a url rule. Since we add a new url rule for each
path + HTTP Verb, Flask was adding OPTIONS to every path. This causes some
paths to not execute the Local Lambda code when calling a path with an OPTIONS
verb. We turn off this behavior by turning off the feature through provide_automatic_options.
@jfuss
jfuss requested a review from sanathkr June 7, 2018 19:02

@sanathkr sanathkr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sanathkr
sanathkr merged commit 1503e08 into aws:develop Jun 8, 2018
@meza

meza commented Oct 25, 2018

Copy link
Copy Markdown

I'm pretty sure this regressed somehow :/

@paulmowat

Copy link
Copy Markdown

I've just hit this issue as well. I have logic within my lamba to deal with some cors and set cors against the globals -> api but soon as i try to do a options request it fails with a 403 before it gets near the lambda.

@jfuss

jfuss commented Nov 15, 2018

Copy link
Copy Markdown
Contributor Author

@paulmowat I reopened #400 20 days ago and asked for a template so we can debug and figure out what else is the error. It seems this was not enough and something else is playing into Flask not resolving the correct handler to call. I have a hunch but need something I can reproduce with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants