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

Expose *gin.Context to AllowOriginFunc #67

Closed
wants to merge 1 commit into from

Conversation

zapo
Copy link

@zapo zapo commented Jun 26, 2020

Allow users of AllowOriginFunc to have custom origin allowance logic based on request data or things stashed in gin.Context (in my case an other middleware is stashing allowed origins using gin.Context.Set).

Fixes #64

@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2020

Codecov Report

Merging #67 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #67   +/-   ##
=======================================
  Coverage   93.02%   93.02%           
=======================================
  Files           3        3           
  Lines         172      172           
=======================================
  Hits          160      160           
  Misses         11       11           
  Partials        1        1           
Impacted Files Coverage Δ
cors.go 81.53% <ø> (ø)
config.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0223cb8...3041d01. Read the comment docs.

@hiendaovinh
Copy link

hiendaovinh commented Oct 6, 2022

Can we have this shipped soon, please?
With a rework to change parameter order by moving the context to the head?
Thank you!

@jub0bs
Copy link

jub0bs commented Oct 25, 2022

I'm curious about this... I believe that this functionality is a potentially dangerous misfeature. What are actual use cases? What kind of information about the request do you need? Note that none of the test cases currently illustrate how this functionality would be useful for...

@appleboy
Copy link
Member

appleboy commented Mar 6, 2024

move to #140

@appleboy appleboy closed this Mar 6, 2024
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.

need transfer gin.Context to AllowOriginFunc
5 participants