Problem description
A signed URL request fails because the x-oss-additional-headers parameter lists headers that are absent from the actual request, or includes headers with underscores (_).
Causes
The error occurs for one of two reasons:
A header listed in
x-oss-additional-headersdoes not exist in the actual request headers.A header name in
x-oss-additional-headerscontains underscores (_).
Examples
In the following request, range is listed in x-oss-additional-headers but is not sent as a request header:
GET /test.txt?x-oss-signature-version=OSS2&x-oss-additional-headers=host;range&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.comSolutions
Remove underscores from header names. Make sure no header listed in
x-oss-additional-headerscontains underscores (_).Remove headers that are not sent in the request. Delete any header from
x-oss-additional-headersthat does not appear in the actual request headers. In the corrected request below,rangeis removed fromx-oss-additional-headers: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
You can use an SDK to send requests. SDKs automatically sign your requests. For more information, see Use Alibaba Cloud SDKs to initiate requests.