Skip to content

Breaking change in 3.1.8: using config.import with gives "[//] give is not a valid HTTP URL" #2304

@MarkvanOsch

Description

@MarkvanOsch

Describe the bug

After upgrading from 3.1.7 to 3.1.8 using config.import with optional and using default "://" gives a "[//] is not a valid HTTP URL error".

Stacktrace:

Caused by: java.lang.IllegalArgumentException: [//] is not a valid HTTP URL
	at org.springframework.web.util.UriComponentsBuilder.fromHttpUrl(UriComponentsBuilder.java:316)

Sample
Using this config in application.yml:

spring:
    config.import:
      - optional:vault://
      - optional:configserver:${SPRING_CLOUD_CONFIG_URI://}

As reference this should still be valid use:
Conditionally enable/disable Vault Configuration
In some cases, it can be required to launch an application without Vault. You can express whether a Vault config location should be optional or mandatory (default) through the location string:

optional:vault:// (default location)

See: https://docs.spring.io/spring-cloud-vault/docs/current/reference/html/config-data.html

Using these dependencies:

<spring-boot.version>2.7.13</spring-boot.version>
<spring-cloud.version>2021.0.8</spring-cloud.version>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions