0002-00000420
Updated at:
Problem description
The value of the X-Amz-SignedHeaders request parameter is missing the required host field.
Cause
You sent a request that uses an Amazon S3-compatible V4 signature, but the value of the X-Amz-SignedHeaders request parameter is missing the required host field.
Example problem
You sent a request that includes the signature in its URL parameters, but the value of the X-Amz-SignedHeaders parameter is missing the required host field.
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=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: bytes=100-900
x-oss-s3-compat: true
Solution
Add the required host field to the value of the X-Amz-SignedHeaders parameter and ensure that all parameters in the URL request are complete and correct. The following code provides a correct example:
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: bytes=100-900
x-oss-s3-compat: true
We recommend that you use Amazon S3 SDKs to initiate the request. For more information, see Use Amazon S3 SDKs to access OSS.
Is this page helpful?