0002-00000424

更新时间:
复制 MD 格式

Problem description

The Host header is missing from the request.

Causes

The request uses Amazon S3-compatible V4 signature, but the Host header is absent. Because X-Amz-SignedHeaders=host declares Host as part of the signature scope, the header must be present in every signed request.

Examples

The following request includes the signature in the URL parameters but omits the Host header:

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
x-oss-s3-compat: true

Solutions

Add the Host header to the request and make sure all URL parameters are correct:

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=ab2s**** 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

To avoid this error, use Amazon S3 SDKs to send requests. SDKs handle header construction and signing automatically. For details, see Use Amazon S3 SDKs to access OSS.