好的,我 copy了所有的 HTTP 请求,第三个 curl 发生了 403 error
curl 'https://us-api.leancloud.cn/1.1/fileTokens' -X OPTIONS -H 'pragma: no-cache' -H 'access-control-request-headers: content-type,x-lc-id,x-lc-session,x-lc-sign,x-lc-ua' -H 'access-control-request-method: POST' -H 'origin: http://localhost:8080' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' -H 'accept: */*' -H 'cache-control: no-cache' -H 'authority: us-api.leancloud.cn' -H 'dnt: 1' --compressed ;
curl 'https://us-api.leancloud.cn/1.1/fileTokens' -H 'x-lc-ua: LeanCloud-JS-SDK/3.6.4 (Browser)' -H 'origin: http://localhost:8080' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7' -H 'x-lc-sign: ...' -H 'pragma: no-cache' -H 'x-lc-session: ...' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' -H 'content-type: application/json;charset=UTF-8' -H 'accept: */*' -H 'cache-control: no-cache' -H 'authority: us-api.leancloud.cn' -H 'referer: http://localhost:8080/' -H 'x-lc-id: ...' -H 'dnt: 1' --data-binary '{"key":"3164b80ac96c94cad6a3.png","name":"97_test.png","metaData":{"size":22367,"owner":"5abda909f84da5fa7623268f"}}' --compressed ;
下面这个发生403问题
curl 'https://avos-cloud-fmnjeeu8un2b.s3.amazonaws.com/3164b80ac96c94cad6a3.png?x-amz-acl=public-read&Signature=3q0zOEPjVcmFf%2BSUA5TaHO9uc4Q%3D&AWSAccessKeyId=AKIAJ7Z2RFWPKWEGGHEQ&Expires=1522644300' -X OPTIONS -H 'Pragma: no-cache' -H 'Access-Control-Request-Method: PUT' -H 'Origin: http://localhost:8080' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' -H 'Accept: */*' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Access-Control-Request-Headers: cache-control,content-type' --compressed ;
curl 'https://us-api.leancloud.cn/1.1/fileCallback' -X OPTIONS -H 'pragma: no-cache' -H 'access-control-request-headers: content-type,x-lc-id,x-lc-session,x-lc-sign,x-lc-ua' -H 'access-control-request-method: POST' -H 'origin: http://localhost:8080' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' -H 'accept: */*' -H 'cache-control: no-cache' -H 'authority: us-api.leancloud.cn' -H 'dnt: 1' --compressed ;
curl 'https://us-api.leancloud.cn/1.1/fileCallback' -H 'x-lc-ua: LeanCloud-JS-SDK/3.6.4 (Browser)' -H 'origin: http://localhost:8080' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7' -H 'x-lc-sign: ...' -H 'pragma: no-cache' -H 'x-lc-session: ...' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' -H 'content-type: application/json;charset=UTF-8' -H 'accept: */*' -H 'cache-control: no-cache' -H 'authority: us-api.leancloud.cn' -H 'referer: http://localhost:8080/' -H 'x-lc-id: ...' -H 'dnt: 1' --data-binary '{"token":"vW8xPco9zXE8Hxkq","result":false}' --compressed