{"action":"closed","issue":{"url":"https://api.github.com/repos/vmware/dispatch/issues/174","repository_url":"https://api.github.com/repos/vmware/dispatch","labels_url":"https://api.github.com/repos/vmware/dispatch/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/vmware/dispatch/issues/174/comments","events_url":"https://api.github.com/repos/vmware/dispatch/issues/174/events","html_url":"https://github.com/vmware/dispatch/issues/174","id":293999788,"number":174,"title":"api-gateway - cors and OPTIONS","user":{"login":"seanhuxy","id":7037564,"avatar_url":"https://avatars2.githubusercontent.com/u/7037564?v=4","gravatar_id":"","url":"https://api.github.com/users/seanhuxy","html_url":"https://github.com/seanhuxy","followers_url":"https://api.github.com/users/seanhuxy/followers","following_url":"https://api.github.com/users/seanhuxy/following{/other_user}","gists_url":"https://api.github.com/users/seanhuxy/gists{/gist_id}","starred_url":"https://api.github.com/users/seanhuxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanhuxy/subscriptions","organizations_url":"https://api.github.com/users/seanhuxy/orgs","repos_url":"https://api.github.com/users/seanhuxy/repos","events_url":"https://api.github.com/users/seanhuxy/events{/privacy}","received_events_url":"https://api.github.com/users/seanhuxy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-02T19:37:42Z","updated_at":"2018-02-07T21:22:47Z","closed_at":"2018-02-07T21:22:47Z","author_association":"CONTRIBUTOR","body":"<!--- Provide a general summary of the issue in the Title above -->\r\n\r\ncurrent API-Gateway supports cors with kong cors plugins. However, it doesn't work well with A CORS preflight request (refer to: https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request), which basically a http OPTIONS request to check if CORS protocol is understood by the server. \r\n\r\n- [X] Bug\r\n- [ ] Feature\r\n- [ ] Enhancement\r\n\r\n## Detailed Description\r\n<!--- Provide a detailed description of the change or addition you are proposing -->\r\n\r\nwhen cors enable: we should not only install kong cors plugin, but also enable http OPTIONS method,\r\nwe should also enable the the transform of http query parameter to http body for OPTIONS in dispatch kong plugins, (just like what we did for HTTP GET\r\n\r\nUPDATE: due to kong errors\r\n```\r\n\"gateway error when adding api: kong.updatePlugin: 400, {\\\"config.methods\\\":\\\"\\\\\\\"OPTIONS\\\\\\\" is not allowed. Allowed values are: \\\\\\\"HEAD\\\\\\\", \\\\\\\"GET\\\\\\\", \\\\\\\"POST\\\\\\\", \\\\\\\"PUT\\\\\\\", \\\\\\\"PATCH\\\\\\\", \\\\\\\"DELETE\\\\\\\"\\\"}\\n\"\r\n```\r\n- need to add OPTIONS for a cors enabled apis\r\n- but need to remove OPTIONS method when creating/updating the api cors plugin\r\n\r\n## Context\r\n<!--- Why is this change important to you? How would you use it? -->\r\n<!--- How can it benefit other users? -->\r\n\r\n## Possible Implementation\r\n<!--- Not obligatory, but suggest an idea for implementing addition or change -->\r\n\r\n## Complexity\r\n<!--- An estimate on the complexity of the implementation -->\r\n- [X] Low - Simple enhancement or bug fix, no architectural changes or refactoring\r\n- [ ] Medium - Change requires some thought, but is relatively isolated\r\n- [ ] High - Significant architectural change or large refactor\r\n\r\n## Impact\r\n<!--- How much does this issue impact you or your business -->\r\n- [ ] Low - Annoyance, but does not impact business or functinality\r\n- [X] Medium - Issue can be worked around, but is causing pain\r\n- [ ] High - Blocker\r\n\r\n## Your Environment\r\n<!--- Include as many relevant details about the environment you experienced the bug in -->\r\n* Dispatch CLI version (or git commit):\r\n* Dispatch Chart version (or image[s] tag):\r\n* Operating System and version:\r\n* Kubernetes version (and distribution):\r\n* Etc (any other useful environmental information):"}}
{"actor":{"display_login":"seanhuxy"}}