To preview CSV and JSON files from OSS in the Designer visual modeling platform, you must enable cross-origin resource sharing (CORS) for the OSS bucket that contains the files. This topic describes how to configure CORS.
Prerequisites
You must have management permissions for the target OSS bucket. For more information, see Cloud product dependencies and authorization: Designer.
Procedure
Go to the details page of a bucket.
Log on to the OSS console.
In the left-side navigation pane, click Buckets.
On the Buckets page, find the OSS bucket that you want to manage and click the bucket name.
-
On the bucket details page, click Content Security > CORS.
-
On the CORS page, click Create Rule. In the Create Rule panel, configure the following parameters.
Parameter
Required
Description
Source
Yes
Specify the origins that are allowed to send cross-origin requests. Set this parameter to the following values:
https://*.console.aliyun.com http://*.console.aliyun.comAllowed Methods
Yes
Specify the HTTP methods allowed for cross-origin requests. Set this parameter to the following values:
PUT GET POST HEADAllowed Headers
Yes
Specify the request headers allowed in a cross-origin request. Set this parameter to the following values:
authorization content-md5 content-type x-oss-date x-oss-security-token x-oss-user-agent rangeExposed Headers
Yes
Specify the response headers that your application can access. Set this parameter to the following values:
etag x-oss-request-idCache Timeout
No
Specify the cache duration in seconds for the results of a preflight (OPTIONS) request.
Vary: Origin
No
Specify whether to include the Vary: Origin header in the response.
If you expect both CORS and non-CORS requests, or if the Origin header can have multiple values, select Vary: Origin to prevent caching issues in the browser.
ImportantSelecting Vary: Origin may increase browser requests or CDN back-to-origin requests.
-
Click OK.