diff --git a/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx b/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx index a4087a36cf..35894e9bfb 100644 --- a/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx +++ b/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx @@ -102,8 +102,14 @@ const SendMessage: React.FC = () => { }) => { if (messageSchema) { const { partition, key, content } = data; - const headers = data.headers ? JSON.parse(data.headers) : undefined; const errors = validateMessage(key, content, messageSchema); + if (data.headers) { + try { + JSON.parse(data.headers); + } catch (error) { + errors.push('Wrong header format'); + } + } if (errors.length > 0) { const errorsHtml = errors.map((e) => `