[rest] Allow colons and dashes in sse topic filter validator (#1052)
Fixes #1043 Signed-off-by: Feras Almanna <firas.almanna3@gmail.com>pull/1054/head
parent
d2af7a350b
commit
b48f1c1925
|
@ -30,7 +30,7 @@ import org.glassfish.jersey.media.sse.OutboundEvent;
|
|||
* @author Dennis Nobel - Changed EventBean
|
||||
*/
|
||||
public class SseUtil {
|
||||
static final String TOPIC_VALIDATE_PATTERN = "(\\w*\\*?\\/?,?\\s*)*";
|
||||
static final String TOPIC_VALIDATE_PATTERN = "(\\w*\\*?\\/?,?:?-?\\s*)*";
|
||||
|
||||
/**
|
||||
* Creates a new {@link OutboundEvent} object containing an {@link EventBean} created for the given Eclipse
|
||||
|
|
|
@ -52,6 +52,8 @@ public class SseUtilTest {
|
|||
assertThat(SseUtil.isValidTopicFilter("////////////"), is(true));
|
||||
assertThat(SseUtil.isValidTopicFilter("*/added"), is(true));
|
||||
assertThat(SseUtil.isValidTopicFilter("*added"), is(true));
|
||||
assertThat(SseUtil.isValidTopicFilter("smarthome/test/test:test:123/test"), is(true));
|
||||
assertThat(SseUtil.isValidTopicFilter("smarthome/test/test-test-123-test:test:123/test"), is(true));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue