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

chore: add cors method option #2103

Merged
merged 3 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions web/src/components/Plugin/UI/cors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const Cors: React.FC<Props> = ({ form, schema }) => {
>
{[
'*',
'**',
'GET',
'HEAD',
'POST',
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/Plugin/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export default {
'component.pluginForm.cors.allow_headers.tooltip':
'Which headers are allowed to set in request when access cross-origin resource. Multiple value use , to split. When allow_credential is false, you can use * to indicate allow all request headers. You also can allow any header forcefully using ** even already enable allow_credential, but it will bring some security risks.',
'component.pluginForm.cors.expose_headers.tooltip':
'Which headers are allowed to set in response when access cross-origin resource. Multiple value use , to split.',
'Which headers are allowed to set in response when access cross-origin resource. Multiple value use , to split. When allow_credential is false, you can use * to indicate allow any header. You also can allow any header forcefully using ** even already enable allow_credential, but it will bring some security risks.',
okaybase marked this conversation as resolved.
Show resolved Hide resolved
'component.pluginForm.cors.max_age.tooltip':
'Maximum number of seconds the results can be cached.. Within this time range, the browser will reuse the last check result. -1 means no cache. Please note that the maximum value is depended on browser, please refer to MDN for details.',
'Maximum number of seconds the results can be cached. Within this time range, the browser will reuse the last check result. -1 means no cache. Please note that the maximum value is depended on browser, please refer to MDN for details.',
'component.pluginForm.cors.allow_credential.tooltip':
"If you set this option to true, you can not use '*' for other options.",
'component.pluginForm.cors.allow_origins_by_regex.tooltip':
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/Plugin/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export default {
'component.pluginForm.cors.allow_methods.tooltip':
'允许跨域访问的 Method,比如: GET,POST等。多个值使用 , 分割,allow_credential 为 false 时可以使用 * 来表示所有 Origin 均允许通过。你也可以在启用了 allow_credential 后使用 ** 强制允许所有 Method 都通过,但请注意这样存在安全隐患。',
'component.pluginForm.cors.allow_headers.tooltip':
'允许跨域访问时请求方携带哪些非 CORS规范 以外的 Header, 多个值使用 , 分割,allow_credential 为 false 时可以使用 * 来表示所 有 Header 均允许通过。你也可以在启用了 allow_credential 后使用 ** 强制允许所有 Method 都通过,但请注意这样存在安全隐患。',
'允许跨域访问时请求方携带哪些非 CORS 规范 以外的 Header, 多个值使用 , 分割,allow_credential 为 false 时可以使用 * 来表示所有 Header 均允许通过。你也可以在启用了 allow_credential 后使用 ** 强制允许所有 Header 都通过,但请注意这样存在安全隐患。',
'component.pluginForm.cors.expose_headers.tooltip':
'允许跨域访问时响应方携带哪些非 CORS规范 以外的 Header, 多个值使用 , 分割。',
'允许跨域访问时响应方携带哪些非 CORS 规范 以外的 Header, 多个值使用 , 分割,allow_credential 为 false 时可以使用 * 来表示允许任意 Header 。你也可以在启用了 allow_credential 后使用 ** 强制允许任意 Header ,但请注意这样存在安全隐患。',
'component.pluginForm.cors.max_age.tooltip':
'浏览器缓存 CORS 结果的最大时间,单位为秒,在这个时间范围内浏览器会复用上一次的检查结果,-1 表示不缓存。',
'component.pluginForm.cors.allow_credential.tooltip':
Expand Down