Open caixunshi opened 1 year ago
This cannot be considered a bug, access addresses cannot contain spaces. Alternatively, you can write SpEL to remove spaces, as shown in the example code:
spring:
cloud:
gateway:
discovery:
locator:
enabled: true
urlExpression: "'lb://'+serviceId"
predicates:
- name: Path
args:
patterns: "'/'+serviceId+'/**'.replaceAll(' ','')"
This is not an interface path, it is a service path. Registering a service name with eureka starts with an empty string, causing all SpringCloud gateway based services to start with an error
Is your feature request related to a problem? Please describe. If an illegal appname is registered on Eureka, such as "lb:// ", it will cause the service to fail to start and throw "Illegal character in authority at index 5: lb://"
Describe the solution you'd like filter out illegal appnames during startup
Describe alternatives you've considered When registering a service for the eureka client, if it is an illegal uri, block the registration of the service and throw an exception
Additional context Add any other context or screenshots about the feature request here.