Skip to content
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(cors) follow mozilla guidelines for preflight request #4029

Merged
merged 5 commits into from
Nov 30, 2018

Conversation

aslafy-z
Copy link
Contributor

@aslafy-z aslafy-z commented Nov 28, 2018

Summary

Follow the mozilla guidelines for preflight request (https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request) for the cors plugin implementation.

Full changelog

  • On OPTIONS requests
    • Send 200 instead of 204
    • Set Content-Length to 0

Issues resolved

Fixes #4008

@CLAassistant
Copy link

CLAassistant commented Nov 28, 2018

CLA assistant check
All committers have signed the CLA.

@aslafy-z aslafy-z force-pushed the fix/cors-http-codes branch from 76f6736 to 05fa3d7 Compare November 28, 2018 16:57
@aslafy-z aslafy-z force-pushed the fix/cors-http-codes branch from 05fa3d7 to b89e799 Compare November 28, 2018 17:25
Copy link
Member

@thibaultcha thibaultcha left a comment

Choose a reason for hiding this comment

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

Thanks for the patch! Mind addressing the review?

kong/plugins/cors/handler.lua Outdated Show resolved Hide resolved
@thibaultcha thibaultcha added this to the 1.0.0rc4 milestone Nov 30, 2018
@thibaultcha thibaultcha merged commit da8b4c2 into Kong:next Nov 30, 2018
@thibaultcha
Copy link
Member

Thank you! Don't forget to claim your Contributor T-shirt :)

@dzmitry-lahoda
Copy link

I do not get it. Link in description says 204 is valid response

image

but merged code uses 200

i do not get it ...

@thibaultcha
Copy link
Member

The page was updated since then. See its contents on Sept 30th, 2018: https://web.archive.org/web/20180930031917/https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request

@ms2008
Copy link
Contributor

ms2008 commented May 17, 2023

I think the main reason has been clarified here

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.

5 participants