duanping2809 2018-02-07 20:29
浏览 15

在Azure存储元数据中使用国际字符?

When I run this request using this azure library:

blobURL.PutBlob(ctx, strings.NewReader("Some text"), azblob.BlobHTTPHeaders{}, azblob.Metadata{"Foo": "/愛知県/bar"}, azblob.BlobAccessConditions{})

I get this error:

===== RESPONSE ERROR (ServiceCode=AuthenticationFailed) =====
Description=Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:daf8a672-001e-000e-2f4b-a033f3000000
Time:2018-02-07T19:38:09.6740273Z, Details: 
   AuthenticationErrorDetail: The MAC signature found in the HTTP request 'REDACTED' is not the same as any computed signature. Server used following string to sign: 'PUT

9

x-ms-blob-cache-control:
x-ms-blob-content-disposition:
x-ms-blob-content-encoding:
x-ms-blob-content-language:
x-ms-blob-content-type:
x-ms-blob-type:BlockBlob
x-ms-client-request-id:f18fd538-3780-4f62-5236-777ac244affa
x-ms-date:Wed, 07 Feb 2018 19:38:09 GMT
x-ms-meta-foo:/愛知県/bar
x-ms-version:2016-05-31
/MYACCOUNT/MYCONTAINER/ReadMe.txt
timeout:61.
   PUT https://MYACCOUNT.blob.core.cloudapi.de/MYCONTAINER/ReadMe.txt?timeout=61
   Authorization: REDACTED
   Content-Length: [9]
   User-Agent: [Azure-Storage/0.1 (go1.9.3; darwin)]
   X-Ms-Blob-Cache-Control: []
   X-Ms-Blob-Content-Disposition: []
   X-Ms-Blob-Content-Encoding: []
   X-Ms-Blob-Content-Language: []
   X-Ms-Blob-Content-Type: []
   X-Ms-Blob-Type: [BlockBlob]
   X-Ms-Client-Request-Id: [f18fd538-3780-4f62-5236-777ac244affa]
   X-Ms-Date: [Wed, 07 Feb 2018 19:38:09 GMT]
   X-Ms-Meta-Foo: [/愛知県/bar]
   X-Ms-Version: [2016-05-31]
   --------------------------------------------------------------------------------
   RESPONSE Status: 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
   Content-Length: [936]
   Content-Type: [application/xml]
   Date: [Wed, 07 Feb 2018 19:38:09 GMT]
   Server: [Microsoft-HTTPAPI/2.0]
   X-Ms-Request-Id: [daf8a672-001e-000e-2f4b-a033f3000000]


exit status 1

Is this because "/愛知県/bar" != "/愛知県/bar"? Do you see any way to set non-ascii character like "/愛知県/bar" as a metadata value?

  • 写回答

1条回答 默认 最新

  • douding6266 2018-02-08 18:47
    关注

    Since you mentioned Go in the tag, I assume you are looking for using a transliterator, there is this one in github which you should try : https://github.com/rainycape/unidecode

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度