Use stricter document properties separator logic

Update `OriginTrackedPropertiesLoader` with stricter logic around the
document separator. If the preceding or following lines are comments
then the separator will be ignored.

Closes gh-22963
This commit is contained in:
Phillip Webb
2020-10-27 21:43:44 -07:00
parent 0588e989af
commit cf673cee55
4 changed files with 71 additions and 22 deletions

View File

@@ -886,7 +886,8 @@ For `application.properties` files a special `#---` comment is used to mark the
spring.application.name=MyCloudApp
----
NOTE: Property file separators must not have any leading or trailing whitespace and must have exactly three hyphen characters.
NOTE: Property file separators must not have any leading whitespace and must have exactly three hyphen characters.
The lines immediately before and after the separator must not be comments.
TIP: Multi-document property files are often used in conjunction with activation properties such as `spring.config.activate.on-profile`.
See the <<boot-features-external-config-file-activation-properties, next section>> for details.