Azure / azure-storage-cpplite

Lite version of C++ Client Library for Microsoft Azure Storage
MIT License
25 stars 44 forks source link

`header_ms_date` is mistakenly following system's locale settings #83

Closed egnchen closed 4 years ago

egnchen commented 4 years ago

Using this package here to do some azure blob storage development. Worked fine on my cloud ubuntu VM but received endless 403 responses on my ubuntu laptop.

Turns out get_ms_date in src/utility.cpp is mistakenly following system locale settings. My laptop have locale settings as simplified Chinese, which causes strftime to output Chinese date & time strings. Such date & time information won't be recognized by azure and thus 403.

Workaround: Plz use std::time_put instead of strftime in get_ms_date, locale settings of which can be specified(reference here).

egnchen commented 4 years ago

PS. Only a dozen tests failed on my zh-CN linux machine, strange...

Jinming-Hu commented 4 years ago

Hi @eyeKill, can you take time to verify if this issue has been fixed in PR https://github.com/Azure/azure-storage-cpplite/pull/85? Thanks.

egnchen commented 4 years ago

Problem resolved, no more 403s(although I don't understand the reason to treat rfc1123 and iso8601 separately).