robinrodricks / FluentStorage

A polycloud .NET cloud storage abstraction layer. Provides Blob storage (AWS S3, GCP, FTP, SFTP, Azure Blob/File/Event Hub/Data Lake) and Messaging (AWS SQS, Azure Queue/ServiceBus). Supports .NET 5+ and .NET Standard 2.0+. Pure C#.
MIT License
291 stars 40 forks source link

Connection strings with '+' will get replaced by spaces #10

Closed rbarbosadhc closed 1 year ago

rbarbosadhc commented 1 year ago

The Connection string parser will call UrlDecode() on the parsed output https://github.com/robinrodricks/FluentStorage/blob/develop/FluentStorage/ConnectionString/StorageConnectionString.cs#L131

Which calls Netbox's UrlDecode, and strips the plus sign from the string https://github.com/aloneguid/netbox/blob/master/src/NetBox/WebUtility.cs#L146

Currently Azure Blob Storage key's have plus signs and it makes it impossible connect to when this happens.

rbarbosadhc commented 1 year ago

After further digging, found the issue in the original project; https://github.com/aloneguid/storage/issues/227

Replace + with %2B

sbruyere commented 1 year ago

I just met the same issue and, IMHO, this issue shouldn't be closed because the documentation doesn't mention that connection string keys need to be URL encoded. Users face problems when Azure Blob Storage keys have plus signs, as they get stripped by the UrlDecode() function.

Although @rbarbosadhc provided a temporary fix by replacing "+" with "%2B," the documentation should be updated to clarify this requirement. Additionally, it's worth considering an update to the StorageConnectionString class to handle URL encoding automatically.