To preview CSV and JSON objects stored in an Object Storage Service (OSS) bucket in Machine Learning Designer, you must enable cross-origin resource sharing (CORS) for the bucket. This topic describes how to enable CORS for an OSS bucket.
Prerequisites
You are granted permissions to access the OSS bucket that stores the objects to be previewed. For more information, see Grant the permissions that are required to use Machine Learning 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 details page of the bucket, choose Content Security > Cross-Origin Resource Sharing (CORS).
On the Cross-Origin Resource Sharing (CORS) page, click Create Rule. In the Create Rule panel, configure the parameters described in the following table.
Parameter
Required
Description
Sources
Yes
The sources of cross-region requests that you want to allow. Use the following addresses for this parameter:
https://*.console.aliyun.com http://*.console.aliyun.com
Allowed Methods
Yes
The methods that cross-region requests are allowed to use. Select the following methods:
PUT GET POST HEAD
Allowed Headers
Yes
The response headers for the allowed cross-region requests. Use the following headers for this parameter:
authorization content-md5 content-type x-oss-date x-oss-security-token x-oss-user-agent range
Exposed Headers
Yes
The response headers that are exposed to your applications. Use the following headers for this parameter:
etag x-oss-request-id
Cache Timeout (Seconds)
No
The timeout period of the response that is cached by the browser for an OPTIONS preflight request destined for specific resources.
Vary: Origin
No
Specifies whether to return the Vary: Origin header.
If both CORS and non-CORS requests are sent to OSS, or if the Origin header has multiple possible values, we recommend that you select the Vary: Origin header to prevent errors in the local cache.
ImportantIf Vary: Origin is selected, visits over the browser or the CDN back-to-origin requests may increase.
Click OK.