mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-04 00:09:01 +00:00
Fix springProfile with multi profiles separated by comma and whitespace
Previously springProfile supported multi profiles separated by comma but it doesn´t work if there are whitespaces. Now, springProfile will read values cleaning whitespaces. See gh-4445
This commit is contained in:
committed by
Phillip Webb
parent
6a32955cd4
commit
bd709f30c5
+2
-2
@@ -67,8 +67,8 @@ class SpringProfileAction extends Action implements InPlayListener {
|
||||
}
|
||||
|
||||
private boolean acceptsProfiles(InterpretationContext ic, Attributes attributes) {
|
||||
String[] profileNames = StringUtils
|
||||
.commaDelimitedListToStringArray(attributes.getValue(NAME_ATTRIBUTE));
|
||||
String[] profileNames = StringUtils.trimArrayElements(StringUtils
|
||||
.commaDelimitedListToStringArray(attributes.getValue(NAME_ATTRIBUTE)));
|
||||
if (profileNames.length != 0) {
|
||||
for (String profileName : profileNames) {
|
||||
OptionHelper.substVars(profileName, ic, this.context);
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<include resource="org/springframework/boot/logging/logback/base.xml" />
|
||||
<springProfile name="production,test">
|
||||
<springProfile name="production, test">
|
||||
<logger name="org.springframework.boot.logging.logback" level="TRACE" />
|
||||
</springProfile>
|
||||
</configuration>
|
||||
|
||||
Reference in New Issue
Block a user