Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
S3在url中使用@的奇怪行为_Url_Amazon S3_Urlencode - Fatal编程技术网

S3在url中使用@的奇怪行为

S3在url中使用@的奇怪行为,url,amazon-s3,urlencode,Url,Amazon S3,Urlencode,这样的路径在S3中工作: https://s3-us-west-1.amazonaws.com/custom.domain/foo@example.ext 它在URL编码时也可以工作: https://s3-us-west-1.amazonaws.com/custom.domain/foo%40example.ext https://custom.domain/foo%40example.ext 但是,对于自定义域,它似乎不起作用: https://custom.domain/foo@ex

这样的路径在S3中工作:

https://s3-us-west-1.amazonaws.com/custom.domain/foo@example.ext
它在URL编码时也可以工作:

https://s3-us-west-1.amazonaws.com/custom.domain/foo%40example.ext
https://custom.domain/foo%40example.ext
但是,对于自定义域,它似乎不起作用:

https://custom.domain/foo@example.ext
它返回这个错误

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>123/123/image.jpg</Key>
<RequestId>E30151C3D86A2BDA</RequestId>
<HostId>
wDvM7EpyNKyaxCuzxyBDoRFb72jrXacqiPcjTwzJ37HHdtR1CM1/df+bEW2Nld44sOcvarcO8j24=
</HostId>
</Error>
但在URL编码时,它仍然有效:

https://s3-us-west-1.amazonaws.com/custom.domain/foo%40example.ext
https://custom.domain/foo%40example.ext
不知道如何让它工作,或者它是否是S3上的一个bug

更新

奇怪的是,几分钟后它就起作用了,但现在不起作用。任何指点都将不胜感激。多谢各位

更新

也许是个线索:

发生his的原因(也是它自行解析的原因)是,当您设置S3 bucket时,有一段时间全局bucket URL不可用,因此AWS会重定向到特定于区域的URL

当您请求全局URL时,Amazon发回的重定向响应没有CORS头,因此在DNS传播之前,请求将失败

他总结说:

所以,我基本上只需要等到Amazon传播DNS信息(我想大概需要2个小时左右)。但是,由于开发桶(我在开始开发之前创建的…,所以,这是有道理的)没有发生这种情况,所以我迷失了方向