0002-00000428

Updated at:

Description

The list of additional request headers for the signature contains a header that does not exist in the request.

Cause

You initiated an Amazon S3-compatible V4 request, but the list of headers in the X-Amz-SignedHeaders parameter or in the SignedHeaders field of the Authorization request header contains a request header that is not in the request, or a header name contains an underscore (_).

Example

You initiated a request that includes a signature in the URL request parameters, but the list of request headers in the X-Amz-SignedHeaders parameter is incorrect.

GET /test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LTAI****************/20221220/us-east-1/s3/aws4_request&X-Amz-Date=20221220T084818Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host;range&X-Amz-Signature=ab2***st HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
x-oss-s3-compat: true

The value of the X-Amz-SignedHeaders parameter is host;range. This value indicates that two additional request headers, `host` and `range`, are included. However, the `Range` request header is not present in the signed request.

Solutions

  • Make sure that the list of headers in the X-Amz-SignedHeaders parameter or in the SignedHeaders field of the Authorization request header does not contain a header name with an underscore (_).

  • Remove `range` from the X-Amz-SignedHeaders parameter.

    GET /test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LTAI****************/20221220/us-east-1/s3/aws4_request&X-Amz-Date=20221220T084818Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=ab2***st HTTP/1.0
    Date: Tue, 20 Dec 2022 08:48:18 GMT
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
  • If you want to keep the value of the X-Amz-SignedHeaders parameter as host;range, add the `Range` request header to the request.

    GET /test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LTAI****************/20221220/us-east-1/s3/aws4_request&X-Amz-Date=20221220T084818Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host;range&X-Amz-Signature=ab2***st HTTP/1.0
    Date: Tue, 20 Dec 2022 08:48:18 GMT
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
    Range: 0-2560

We recommend that you use Amazon S3 SDKs to initiate the request. For more information, see Use Amazon S3 SDKs to access OSS.