Skip to content

Commit

Permalink
Merge pull request #967 from addicheung/patch-auth-data
Browse files Browse the repository at this point in the history
Make custom namespaces support auth data
  • Loading branch information
mrniko authored Mar 22, 2024
2 parents de4187e + 363b6c6 commit 8243315
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,19 @@ private String readNamespace(ByteBuf frame, final boolean defaultToAll) {

int endIndex = buffer.bytesBefore((byte) '?');
if (endIndex > 0) {
// skip this frame
frame.readerIndex(frame.readerIndex() + frame.readableBytes());
return readString(buffer, endIndex);
String namespace = readString(buffer, endIndex);
if(namespace.startsWith("/")) {
frame.readerIndex(frame.readerIndex() + endIndex + 1);
return namespace;
}
}
endIndex = buffer.bytesBefore((byte) ',');
if (endIndex > 0) {
// skip this frame
frame.readerIndex(frame.readerIndex() + frame.readableBytes());
return readString(buffer, endIndex);
String namespace = readString(buffer, endIndex);
if(namespace.startsWith("/")) {
frame.readerIndex(frame.readerIndex() + endIndex + 1);
return namespace;
}
}
if (defaultToAll) {
// skip this frame
Expand Down

0 comments on commit 8243315

Please sign in to comment.