0002-00000110
Problem description
The AdditionalHeaders field in the Authorization request header is left empty.
Causes
The request uses a V2 signature, but the AdditionalHeaders field in the Authorization request header is empty.
Examples
The following request uses a V2 signature, but the Authorization request header is invalid.
GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2022 08:48:18 GMT
Authorization: OSS2 AccessKeyId:44**07,AdditionalHeaders:,Signature:n7***I0=
A space separates the signature version from the signature information in the Authorization request header:
-
Signature version: Only
OSS2is supported. -
Signature information: A comma-separated list of key:value pairs.
Required keys are
AccessKeyIdandSignature. TheAdditionalHeaderskey is optional. In this example, all three keys are present butAdditionalHeadersis empty.
Solutions
Set the AdditionalHeaders field in the Authorization header to a valid value.
GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2022 08:48:18 GMT
Authorization: OSS2 AccessKeyId:44**07,AdditionalHeaders:host,Signature:n7I**I0=
References
-
To use Alibaba Cloud SDKs to initiate a V2-signed request, see Overview.
-
You can implement the signature yourself.
-
To implement V2 signing yourself, you can refer to the V2 signing implementation in the SDK. For more information, see V2 signature implementation in OSS SDK for Python.
-
To implement the signing logic yourself, you can refer to V1 signing. For more information, see Overview.
When you implement the signature using these methods, if the server returns a
StringToSignstring in the response, check whether the server-side string-to-sign is the same as the one you used for signing. -