Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP 400 for clusters with special symbols #3591

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ const Filters: React.FC<FiltersProps> = ({
// eslint-disable-next-line consistent-return
React.useEffect(() => {
if (location.search?.length !== 0) {
const url = `${BASE_PARAMS.basePath}/api/clusters/${clusterName}/topics/${topicName}/messages${location.search}`;
const url = `${BASE_PARAMS.basePath}/api/clusters/${encodeURIComponent(
clusterName
)}/topics/${topicName}/messages${location.search}`;
const sse = new EventSource(url);

source.current = sse;
Expand Down
4 changes: 3 additions & 1 deletion kafka-ui-react-app/src/lib/hooks/api/ksqlDb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export const useKsqlkDbSSE = ({ clusterName, pipeId }: UseKsqlkDbSSEProps) => {

React.useEffect(() => {
const fetchData = async () => {
const url = `${BASE_PARAMS.basePath}/api/clusters/${clusterName}/ksql/response`;
const url = `${BASE_PARAMS.basePath}/api/clusters/${encodeURIComponent(
clusterName
)}/ksql/response`;
await fetchEventSource(
`${url}?${new URLSearchParams({ pipeId: pipeId || '' }).toString()}`,
{
Expand Down
4 changes: 3 additions & 1 deletion kafka-ui-react-app/src/lib/hooks/api/topicMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export const useTopicMessages = ({
React.useEffect(() => {
const fetchData = async () => {
setIsFetching(true);
const url = `${BASE_PARAMS.basePath}/api/clusters/${clusterName}/topics/${topicName}/messages`;
const url = `${BASE_PARAMS.basePath}/api/clusters/${encodeURIComponent(
clusterName
)}/topics/${topicName}/messages`;
const requestParams = new URLSearchParams({
limit,
seekTo: seekTo.replaceAll('-', '::').replaceAll('.', ','),
Expand Down