forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix OPTIONS handling #1
Comments
douglasnaphas
added a commit
that referenced
this issue
Jan 27, 2020
#1 I need to see how this stack looks and behaves once deployed.
douglasnaphas
added a commit
to douglasnaphas/play-sam
that referenced
this issue
Feb 2, 2020
douglasnaphas/aws-sam-cli#1 To see the problem with OPTIONS described in this Issue: 1. Make one directory where the branch for the PR addressing the issue is checked out, from the awslabs/aws-sam-cli repo (the PR dir). 1. Make another directory where the develop branch of the awslabs/aws-sam-cli repo is checked out (the develop dir). 1. In each of the above two dirs, activate a virtualenv for Python 3.7.4 and run `make init` to make a `samdev` executable available in each virtualenv. 1. In the PR dir, run `samdev local start-api --profile $PROFILE --template $PLAY-SAM/dev-template.yml --port 5000 --host localhost` 1. In the develop dir, run `samdev local start-api --profile $PROFILE --template $PLAY-SAM/dev-template.yml --port 5001 --host localhost` 1. In each dir, run `curl -X OPTIONS -i http://localhost:$PORT` where `$PORT` is 5000 or 5001, depending on the dir. 1. You should get a 200 with `"Output":"hello from options"}` as the response data from the Express server in the PR dir, 200 with no data in the develop dir. This illustrates the issue of OPTIONS not reaching the handler.
douglasnaphas
added a commit
to douglasnaphas/play-sam
that referenced
this issue
Feb 2, 2020
douglasnaphas/aws-sam-cli#1 Running the OPTIONS example template now works with ``` samdev local start-api --profile douglas --template \ ~/repos/play-sam/opts-handler/opts-handler-template.yml --port 5000 \ --host localhost ```
douglasnaphas
added a commit
to douglasnaphas/play-sam
that referenced
this issue
Feb 2, 2020
douglasnaphas/aws-sam-cli#1 This adds a template and handler that mimic the template swagger-template.yml used by tests/integration/local/start_api/test_start_api.py -> TestServiceCorsSwaggerRequests. Running this with similar steps to those listed a couple of commits ago illustrates the failing integration test, when an OPTIONS method is used. `curl -X OPTIONS -i http://localhost:$PORT/echobase64eventbody` fails in the PR dir, but succeeds in the develop dir.
Attempting to build and deploy to CloudFormationBuildAfter
Deploy
|
douglasnaphas
added a commit
to douglasnaphas/play-sam
that referenced
this issue
Feb 6, 2020
douglasnaphas/aws-sam-cli#1 API Gateway sends the revised header with lowercase letters. This was confirmed when hitting the endpoint resulted in an internal server error with title case letters, but a 200 once this change (to lowercase) was deployed.
douglasnaphas
added a commit
to douglasnaphas/play-sam
that referenced
this issue
Feb 6, 2020
douglasnaphas/aws-sam-cli#1 However, the explicity OPTIONS handlers I am adding here do not work once deployed, it seems due to permissions issues.
This says something about how httpMethod must be POST. |
OpenAPI path object rules: https://swagger.io/specification/#pathItemObject. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Upstream issue 1434, PRs 1464 and 1649.
TODO
curl
(see Testing CORS) for OPTIONS handling.The text was updated successfully, but these errors were encountered: