0033-00000003

更新时间:2024-04-29 02:35:33

问题描述

请求体XML配置中AllowEmptyReferer节点取值有误。

问题原因

您发起PutBucketReferer请求配置防盗链,但是请求体XML配置中AllowEmptyReferer节点值不是合法的布尔值。

问题示例

以下请求体XML配置中AllowEmptyReferer节点值为32,取值不合法导致请求错误。

PUT /?referer HTTP/1.1
Date: Fri, 24 Feb 2017 03:15:40 GMT
Content-Length:322
Content-Type: application/xml
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Authorization: OSS qn6q**************:77Dv****************

<?xml version="1.0" encoding="UTF-8"?>
<RefererConfiguration>
	<AllowEmptyReferer>32</AllowEmptyReferer>
  <AllowTruncateQueryString>false</AllowTruncateQueryString>
  <RefererList>
        <Referer>http://www.aliyun.com</Referer>
  </RefererList>
</RefererConfiguration>

解决方案

确保请求体XML配置中AllowEmptyReferer节点值正确。该节点用于指定是否允许Referer字段为空的请求访问OSS。取值如下:

  • true(默认值):允许Referer字段为空的请求访问OSS。

  • false:不允许Referer字段为空的请求访问OSS。

正确请求示例如下:

PUT /?referer HTTP/1.1
Date: Fri, 24 Feb 2017 03:15:40 GMT
Content-Length:322
Content-Type: application/xml
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Authorization: OSS qn6q**************:77Dv****************

<?xml version="1.0" encoding="UTF-8"?>
<RefererConfiguration>
  <AllowEmptyReferer>false</AllowEmptyReferer>
  <AllowTruncateQueryString>false</AllowTruncateQueryString>
  <RefererList>
        <Referer>http://www.aliyun.com</Referer>
  </RefererList>
</RefererConfiguration>

相关文档

  • 本页导读 (1)
  • 问题描述
  • 问题原因
  • 问题示例
  • 解决方案
  • 相关文档
AI助理

点击开启售前

在线咨询服务

你好,我是AI助理

可以解答问题、推荐解决方案等