Skip to content

Commit 739c96e

Browse files
Update pusher/util.py
Co-authored-by: Evgenii Breikin <[email protected]>
1 parent ab64791 commit 739c96e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pusher/util.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,10 @@ def validate_channel(channel):
9292
if len(channel) > 200:
9393
raise ValueError("Channel too long: %s" % channel)
9494

95-
if "server-to-user" in channel:
95+
if channel.startswith(SERVER_TO_USER_PREFIX):
9696
if not server_to_user_channel_re.match(channel):
9797
raise ValueError("Invalid server to user Channel: %s" % channel)
98-
return channel
99-
100-
if not channel_name_re.match(channel):
98+
elif not channel_name_re.match(channel):
10199
raise ValueError("Invalid Channel: %s" % channel)
102100

103101
return channel

0 commit comments

Comments
 (0)