parent
80581f6288
commit
1a916ab247
2 changed files with 5 additions and 3 deletions
|
@ -12,6 +12,7 @@ services:
|
|||
- kafka
|
||||
environment:
|
||||
KAFKA_CLUSTERS_0_NAME: local
|
||||
# SERVER_SERVLET_CONTEXT_PATH: "/kafkaui"
|
||||
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
|
||||
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
|
||||
KAFKA_CLUSTERS_0_PROPERTIES_SECURITY_PROTOCOL: SASL_PLAINTEXT
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.provectus.kafka.ui.config;
|
||||
|
||||
import java.util.Optional;
|
||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
@ -22,13 +23,13 @@ public class CustomWebFilter implements WebFilter {
|
|||
String contextPath = serverProperties.getServlet().getContextPath() != null
|
||||
? serverProperties.getServlet().getContextPath() : "";
|
||||
|
||||
if (exchange.getRequest().getURI().getPath().equals(contextPath + "/")
|
||||
|| exchange.getRequest().getURI().getPath().startsWith(contextPath + "/ui")) {
|
||||
final String path = exchange.getRequest().getURI().getPath().replaceAll("/$", "");
|
||||
if (path.equals(contextPath) || path.startsWith(contextPath + "/ui")) {
|
||||
return chain.filter(
|
||||
exchange.mutate().request(exchange.getRequest().mutate().path("/index.html").build())
|
||||
.build()
|
||||
);
|
||||
} else if (exchange.getRequest().getURI().getPath().startsWith(contextPath)) {
|
||||
} else if (path.startsWith(contextPath)) {
|
||||
return chain.filter(
|
||||
exchange.mutate().request(exchange.getRequest().mutate().contextPath(contextPath).build())
|
||||
.build()
|
||||
|
|
Loading…
Add table
Reference in a new issue