使用Azure Storage SDK在Mono上缺少Content-Length标头

时间:2014-05-03 13:54:47

标签: azure mono azure-storage azure-storage-blobs

如果我从Azure Storage SDK(3.1.0.1)更新元数据中调用CloudBlockBlob.SetMetadataAsync,则所有新值都在请求标头中。此请求为PUT,在Microsoft的.NET上包含Content-Length标头(值0)。但是如果我在Mono 3.4.0(下面的确切版本)下运行它,则会丢失标头,Azure Storage会给我411

有人遇到过这个吗?并且想法如何解决这个问题(到目前为止我没有幸运提取没有Azure Storage SDK的测试用例)?

Mono JIT compiler version 3.4.0 ((no/d4511ef Wed Apr 30 12:04:56 CEST 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

Mono的请求:

PUT /XXX?comp=metadata&timeout=360 HTTP/1.1
User-Agent: WA-Storage/3.1.0.1 (.NET CLR 4.0.30319.17020; Unix 3.10.25.0)
x-ms-version: 2013-08-15
x-ms-client-request-id: 910f1ad9-d877-4548-97d9-34d5d67950d9
x-ms-meta-XXX: DEAD8E77A7AB25FE13E121CF3C05A19A215D3CCD
x-ms-meta-XXX: 2013-02-11T09:25:59.0000000+00:00
x-ms-date: Thu, 01 May 2014 17:49:21 GMT
Authorization: SharedKey XXX:XXX
Host: XXX

Microsoft的.NET请求:

PUT /XXX?comp=metadata&timeout=360 HTTP/1.1
User-Agent: WA-Storage/3.1.0.1 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)
x-ms-version: 2013-08-15
x-ms-client-request-id: 5b5ce8ea-ee2a-4a3b-900e-84e6bbeb1642
x-ms-meta-XXX: DEAD8E77A7AB25FE13E121CF3C05A19A215D3CCD
x-ms-meta-XXX: 2013-02-11T09:25:59.9999999+00:00
x-ms-date: Thu, 01 May 2014 17:55:04 GMT
Authorization: SharedKey XXX:XXX
Host: XXX
Content-Length: 0

1 个答案:

答案 0 :(得分:0)

你似乎受到最近Mono回归的影响。但你可能很幸运地知道它已经在this commit in mono master中得到修复。请自己编译mono master并用它进行测试。如果仍然无法解决您的问题,请使用最小的测试用例在http://bugzilla.xamarin.com中将其报告为错误。