Problem description
The Content-Type header in the object metadata contains invalid characters.
Causes
A PostObject request was submitted with object metadata that includes a Content-Type header value containing one or more invalid characters. Invalid characters include:
Carriage return (
\r)Line feed (
\n)
Examples
The following PostObject form field contains an invalid Content-Type value because the string was constructed with a trailing line feed character:
Content-Type: image/jpeg\nA valid Content-Type value contains only printable ASCII characters with no control characters:
Content-Type: image/jpeg
Content-Type: application/octet-stream
Content-Type: text/plain; charset=UTF-8When constructing PostObject requests programmatically, string concatenation bugs often introduce\ror\ncharacters into header values. Verify that your string-building logic strips trailing whitespace and line endings before setting theContent-Typefield.
Solutions
Inspect the Content-Type value in the form fields of your PostObject request and remove any invalid characters. For the correct format and valid values, see How do I specify the Content-Type header?
References
该文章对您有帮助吗?