Skip to content

Commit a118a7f

Browse files
okaybaselixingwangjuzhiyuanstarsz
authored
chore: add cors method option (#2103)
Co-authored-by: lixingwang <[email protected]> Co-authored-by: Zhiyuan Ju <[email protected]> Co-authored-by: Peter Zhu <[email protected]>
1 parent 59ea8c6 commit a118a7f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

web/src/components/Plugin/UI/cors.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const Cors: React.FC<Props> = ({ form, schema }) => {
7272
>
7373
{[
7474
'*',
75+
'**',
7576
'GET',
7677
'HEAD',
7778
'POST',

web/src/components/Plugin/locales/en-US.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ export default {
4141
'component.pluginForm.cors.allow_headers.tooltip':
4242
'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.',
4343
'component.pluginForm.cors.expose_headers.tooltip':
44-
'Which headers are allowed to set in response when access cross-origin resource. Multiple value use , to split.',
44+
'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.',
4545
'component.pluginForm.cors.max_age.tooltip':
46-
'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.',
46+
'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.',
4747
'component.pluginForm.cors.allow_credential.tooltip':
4848
"If you set this option to true, you can not use '*' for other options.",
4949
'component.pluginForm.cors.allow_origins_by_regex.tooltip':

web/src/components/Plugin/locales/zh-CN.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ export default {
3838
'component.pluginForm.cors.allow_methods.tooltip':
3939
'允许跨域访问的 Method,比如: GET,POST等。多个值使用 , 分割,allow_credential 为 false 时可以使用 * 来表示所有 Origin 均允许通过。你也可以在启用了 allow_credential 后使用 ** 强制允许所有 Method 都通过,但请注意这样存在安全隐患。',
4040
'component.pluginForm.cors.allow_headers.tooltip':
41-
'允许跨域访问时请求方携带哪些非 CORS规范 以外的 Header, 多个值使用 , 分割,allow_credential 为 false 时可以使用 * 来表示所 有 Header 均允许通过。你也可以在启用了 allow_credential 后使用 ** 强制允许所有 Method 都通过,但请注意这样存在安全隐患。',
41+
'允许跨域访问时请求方携带哪些非 CORS 规范 以外的 Header, 多个值使用 , 分割,allow_credential 为 false 时可以使用 * 来表示所有 Header 均允许通过。你也可以在启用了 allow_credential 后使用 ** 强制允许所有 Header 都通过,但请注意这样存在安全隐患。',
4242
'component.pluginForm.cors.expose_headers.tooltip':
43-
'允许跨域访问时响应方携带哪些非 CORS规范 以外的 Header, 多个值使用 , 分割。',
43+
'允许跨域访问时响应方携带哪些非 CORS 规范 以外的 Header, 多个值使用 , 分割,allow_credential 为 false 时可以使用 * 来表示允许任意 Header 。你也可以在启用了 allow_credential 后使用 ** 强制允许任意 Header ,但请注意这样存在安全隐患。',
4444
'component.pluginForm.cors.max_age.tooltip':
4545
'浏览器缓存 CORS 结果的最大时间,单位为秒,在这个时间范围内浏览器会复用上一次的检查结果,-1 表示不缓存。',
4646
'component.pluginForm.cors.allow_credential.tooltip':

0 commit comments

Comments
 (0)