Problem description
The request headers specified by the x-oss-additional-headers field in a signed URL contain one or more nonexistent header fields.
Causes
You sent a request by using a signed URL. However, the request headers that are specified by the x-oss-additional-headers field in the signed URL contain nonexistent header fields.
Examples
You initiated a request that includes the signature in the URL parameter. However, the request headers that are specified by the x-oss-additional-headers field contain one or more nonexistent header fields. In this example, ;host is used as an invalid value of the x-oss-additional-headers field.
GET /test.txt?x-oss-signature-version=OSS2&x-oss-additional-headers= ;host&x-oss-access-key-id=44CF9***&x-oss-expires=1475462111&x-oss-signature=abc*** HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Range: bytes=100-900Solutions
The
x-oss-additional-headersfield is optional. You can delete this field if you do not want to add additional request headers to calculate the signature.If you want to add additional request headers to calculate the signature, add the
x-oss-additional-headersfield in the URL parameter and make sure that a valid value is specified for this field. The following section describes how to construct the x-oss-additional-headers field:All headers in the x-oss-additional-headers field must be lowercase letters.
All headers in the x-oss-additional-headers field are sorted in ascending alphabetical order.
The elements in an array are separated by semicolons (;) to obtain a string.
For example, you must add the Host and Range headers to calculate the signature in the preceding example. In this case, you must set the
x-oss-additional-headersfield tohost;range.
We recommend that you use Alibaba Cloud SDKs to initiate requests. Alibaba Cloud SDKs automatically generate signatures for the requests without the need to manually calculate a signature. For more information, see Overview.