Describe the bug
In ConfigServer Configuration, if I have a comma separated list of Env/Profiles I get an exception from new Uri()
Steps to reproduce
Assuming I have this configuration
{
"Spring": {
"Application":{
"Name": "sample"
},
"Cloud": {
"Config": {
"Uri": "http://localhost:8888",
"Env": "local,staging"
}
}
}
}
ConfigServerConfigurationProvider.cs:570 will throw due to an exception on UriExtensions.ToMaskedString
Even though config server itself allows multiple profiles, the string.split(',') doesn't really make sense
https://github.com/SteeltoeOSS/Steeltoe/blob/main/src/Configuration/src/ConfigServer/ConfigServerConfigurationProvider.cs#L570
https://github.com/SteeltoeOSS/Steeltoe/blob/main/src/Common/src/Common/Extensions/UriExtensions.cs#L20
public static string ToMaskedString(this Uri source)
{
ArgumentNullException.ThrowIfNull(source);
string uris = source.ToString();
if (uris.Contains(','))
{
return string.Join(',',
uris.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).Select(uri => ToMaskedUri(new Uri(uri)).ToString()));
}
return ToMaskedUri(source).ToString();
}
Expected behavior
I expect that the result from config server is returned, and that logging the request does not make the configuration load fail.
Environment (please complete the following information):
- Steeltoe Version 4.0.0-rc1
- Platform: ANY
- OS: ANY
- .NET Version net8.9
Additional context or links
https://github.com/SteeltoeOSS/Steeltoe/blob/main/src/Configuration/src/ConfigServer/ConfigServerConfigurationProvider.cs#L570
https://github.com/SteeltoeOSS/Steeltoe/blob/main/src/Common/src/Common/Extensions/UriExtensions.cs#L20
Describe the bug
In ConfigServer Configuration, if I have a comma separated list of Env/Profiles I get an exception from new Uri()
Steps to reproduce
Assuming I have this configuration
{ "Spring": { "Application":{ "Name": "sample" }, "Cloud": { "Config": { "Uri": "http://localhost:8888", "Env": "local,staging" } } } }ConfigServerConfigurationProvider.cs:570 will throw due to an exception on UriExtensions.ToMaskedString
Even though config server itself allows multiple profiles, the string.split(',') doesn't really make sense
https://github.com/SteeltoeOSS/Steeltoe/blob/main/src/Configuration/src/ConfigServer/ConfigServerConfigurationProvider.cs#L570
https://github.com/SteeltoeOSS/Steeltoe/blob/main/src/Common/src/Common/Extensions/UriExtensions.cs#L20
Expected behavior
I expect that the result from config server is returned, and that logging the request does not make the configuration load fail.
Environment (please complete the following information):
Additional context or links
https://github.com/SteeltoeOSS/Steeltoe/blob/main/src/Configuration/src/ConfigServer/ConfigServerConfigurationProvider.cs#L570
https://github.com/SteeltoeOSS/Steeltoe/blob/main/src/Common/src/Common/Extensions/UriExtensions.cs#L20