0

我使用了七牛提供的GO SDK,想使用前缀key来上传文件。通过后台生成token,并把scope、token返回给前台以调用。现在我使用不了,返回403。报文如下:

------WebKitFormBoundaryZzki5eh3EmZUghAk
Content-Disposition: form-data; name="token"

drSjyXqBRKIi_Obksj6lKBa-m1fNe2CSHBBdxwqm:WdNoSM3ZZGR9W2GDGw1q68rVrAI=:eyJzY29wZSI6ImJhY2tncm91bmRtYW5hZ2U6dGVzdCIsImRlYWRsaW5lIjoxNTAxODQ0NDg5LCJpc1ByZWZpeGFsU2NvcGUiOjF9
------WebKitFormBoundaryZzki5eh3EmZUghAk
Content-Disposition: form-data; name="key"

backgroundmanage:test
------WebKitFormBoundaryZzki5eh3EmZUghAk
Content-Disposition: form-data; name="file"; filename="1469664186665521.jpg"
Content-Type: image/jpeg


------WebKitFormBoundaryZzki5eh3EmZUghAk--

在报文中,key我使用了backgroundmanage:test,在token中,最后一节经过base64解码后json为:

{"scope":"backgroundmanage:test","deadline":1501844489,"isPrefixalScope":1}

而七牛返回给我的报文如下:(httpCode:403)

{"error":"key doesn't match with scope"}

撰写答案