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

docs: improve hertz-cors docs #391

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

BaiZe1998
Copy link
Contributor

What type of PR is this?

docs

What this PR does / why we need it (en: English/zh: Chinese):

en: improve hertz-cors docs
zh: 完善 hertz-cors 的文档

@li-jin-gou li-jin-gou changed the title [WIP] docs: improve hertz-cors docs docs: improve hertz-cors docs Oct 13, 2022
@@ -11,35 +11,232 @@ description: >

hertz 提供 cors 跨域中间件的[实现](https://github.com/hertz-contrib/cors) ,这里的实现参考了 gin 的 cors,使用方法可参考 gin 的 [cors](https://github.com/gin-contrib/cors) 。
Copy link
Contributor

Choose a reason for hiding this comment

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

不要在参考 gin 的了,参考咱自己的吧 :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i got it, thx


该参数设置为 `true` 之后,将允许来自任意 origin 的客户端跨源访问服务端资源。

与 `AllowOriginFunc` 以及 `AllowOrigins` 配置冲突,同时只能配置一项。
Copy link
Contributor

Choose a reason for hiding this comment

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

所有的冲突加粗一下吧。

或者加个注意也不错

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i got it, thx


### AllowOriginFunc

以 origin 为形参,用于自定义的 origin 校验逻辑,返回 `ture` 表示校验通过。
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx

@GuangmingLuo GuangmingLuo merged commit 3f57613 into cloudwego:main Oct 28, 2022
YUandJIANG pushed a commit to YUandJIANG/cloudwego.github.io that referenced this pull request Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants