Problem description
The Cache-Control field value contains invalid characters.
Causes
OSS rejects Cache-Control values that contain control characters. The most common invalid characters are \r (carriage return) and \n (line feed).
Examples
The following example shows a PostObject request that specifies Cache-Control to control caching behavior for the uploaded object. The Cache-Control field accepts these values:
| Value | Behavior |
|---|---|
no-cache | The cache is revalidated with the origin server on each access. If the object has not changed, the cached copy is used; otherwise, the updated object is downloaded. |
no-store | The object is not cached anywhere. |
public | The object can be cached by any cache, including shared caches. |
private | The object is cached only in the client's private cache. |
max-age=<seconds> | The validity period of the cached object, in seconds. This value is available only in HTTP/1.1. |
If the Cache-Control value contains invalid characters such as \r or \n, OSS returns this error.
Solutions
Strip all control characters from the Cache-Control value before submitting the request. In particular, check for \r and \n.
For more information about setting object metadata including Cache-Control, see Manage object metadata.
References
该文章对您有帮助吗?