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

CORS: how is the AllowOriginFunc struct field meant to be unmarshalled from YAML? #2535

Closed
3 tasks done
jub0bs opened this issue Oct 24, 2023 · 5 comments
Closed
3 tasks done

Comments

@jub0bs
Copy link

jub0bs commented Oct 24, 2023

Issue Description

The CORSConfig struct type has the following field:

AllowOriginFunc func(origin string) (bool, error) `yaml:"allow_origin_func"`

The field tag puzzles me. How is such a function meant to be unmarshalled from YAML?

Checklist

  • Dependencies installed
  • No typos
  • Searched existing issues and docs

Version/commit

v4.11.2

@aldas
Copy link
Contributor

aldas commented Oct 24, 2023

This is ordinary copy/paste, people imitate how thing look like in same file.

@aldas
Copy link
Contributor

aldas commented Oct 24, 2023

Feel free to send PR to remove those parts. There are probably other middlewares with fields like that

@jub0bs
Copy link
Author

jub0bs commented Oct 24, 2023

Thanks for clarifying. I thought I was missing something.

@aldas
Copy link
Contributor

aldas commented Oct 24, 2023

@jub0bs , would you like to send PR for it?

@jub0bs
Copy link
Author

jub0bs commented Oct 24, 2023

@aldas Not at this time. Perhaps later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants