-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add Access-Control-Expose-Headers #12446
Add Access-Control-Expose-Headers #12446
Conversation
Fix go-gitea#12424 Signed-off-by: Andrew Thornton <[email protected]>
Should probably only set them if |
Does it matter? I mean it's still semantically useful? |
It shouldn't really matter but CORS-specific headers do not convey any meaning when not using CORS so I see them mostly as garbage information in such a scenario. |
Ideally we should check for the existance of the |
I think that detecting whether CORS is being set etc through use of the Origin header is likely to be error prone - I can't see a problem with just emitting these in any case. Do we really need to add the additional x lines of code to detect if we think CORS is enabled and Origin is set correctly etc. (with all the risk of getting that wrong) in these 14 places to determine whether we strictly need to emit this header that does no harm if it's not strictly needed but does no harm if it's emitted otherwise? |
|
Co-authored-by: silverwind <[email protected]>
Co-authored-by: silverwind <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #12446 +/- ##
==========================================
+ Coverage 43.73% 43.77% +0.03%
==========================================
Files 631 631
Lines 69851 69870 +19
==========================================
+ Hits 30552 30583 +31
+ Misses 34345 34334 -11
+ Partials 4954 4953 -1
Continue to review full report at Codecov.
|
Fix #12424
Signed-off-by: Andrew Thornton [email protected]