URL decoding for cluster names (#1378)
Co-authored-by: Nikita Bystrov <n.bysterov>
This commit is contained in:
parent
a4fce3cd81
commit
0a7d64de78
1 changed files with 4 additions and 1 deletions
|
@ -3,6 +3,8 @@ package com.provectus.kafka.ui.config;
|
||||||
import com.provectus.kafka.ui.exception.ClusterNotFoundException;
|
import com.provectus.kafka.ui.exception.ClusterNotFoundException;
|
||||||
import com.provectus.kafka.ui.exception.ReadOnlyModeException;
|
import com.provectus.kafka.ui.exception.ReadOnlyModeException;
|
||||||
import com.provectus.kafka.ui.service.ClustersStorage;
|
import com.provectus.kafka.ui.service.ClustersStorage;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -32,7 +34,8 @@ public class ReadOnlyModeFilter implements WebFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
var path = exchange.getRequest().getPath().pathWithinApplication().value();
|
var path = exchange.getRequest().getPath().pathWithinApplication().value();
|
||||||
var matcher = CLUSTER_NAME_REGEX.matcher(path);
|
var decodedPath = URLDecoder.decode(path, StandardCharsets.UTF_8);
|
||||||
|
var matcher = CLUSTER_NAME_REGEX.matcher(decodedPath);
|
||||||
if (!matcher.find()) {
|
if (!matcher.find()) {
|
||||||
return chain.filter(exchange);
|
return chain.filter(exchange);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue