diff --git a/CHANGELOG.md b/CHANGELOG.md index 18b60a2..6b78500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- Don't crash on connection strings with trailing semicolon + --- ## 1.1.0 diff --git a/lib/azurex/blob/config.ex b/lib/azurex/blob/config.ex index 2d7101a..ec7b298 100644 --- a/lib/azurex/blob/config.ex +++ b/lib/azurex/blob/config.ex @@ -75,6 +75,9 @@ defmodule Azurex.Blob.Config do iex> parse_connection_string("Key=value") %{"Key" => "value"} + iex> parse_connection_string("Key=value;") + %{"Key" => "value"} + iex> parse_connection_string("Key1=hello;Key2=world") %{"Key1" => "hello", "Key2" => "world"} @@ -85,7 +88,7 @@ defmodule Azurex.Blob.Config do def parse_connection_string(connection_string) do connection_string - |> String.split(";") + |> String.split(";", trim: true) |> Enum.map(&String.split(&1, "=", parts: 2)) |> Map.new(fn [key, value] -> {key, value} end) end