fixes issue with query string parsing when a z exists

closes #127
This commit is contained in:
Adam Cooke
2017-05-16 15:25:35 +01:00
parent 4106ac6c7e
commit 36db40cfe7
2 changed files with 46 additions and 1 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ module Postal
end
def to_hash
@hash ||= @string.scan(/([a-z]+)\:\s*(?:(\d{2,4}\-\d{2}-\d{2}\s\d{2}\:\d{2})|\"(.*?)\"|(.*?))[\s\z]/).each_with_object({}) do |(key, date, string_with_spaces, value), hash|
@hash ||= @string.scan(/([a-z]+)\:\s*(?:(\d{2,4}\-\d{2}-\d{2}\s\d{2}\:\d{2})|\"(.*?)\"|(.*?))(\s|\z)/).each_with_object({}) do |(key, date, string_with_spaces, value), hash|
if date
actual_value = date
elsif string_with_spaces