Skip to content

Conversation

@GooDer
Copy link

@GooDer GooDer commented Jul 17, 2023

Fixed maximum length of route metadata

Motivation:

I encountered problem in our project where we are using rsocket to communication with Java server.
We have for some legacy reason very long URL path to Java endpoint which is around 138 characters long.

>           serialized += struct.pack('>b', len(tag))
E           struct.error: byte format requires -128 <= number <= 127

In this case the rsocket throw error on preparation of length byte for the tag. From the code I believe that the intention was to allow size of 0 - 255 but right now it is -128 to 127 and that raise the error. Also length check was wrong in this case since we have 256 "values" with zero included but maximum length is still 255.

Modifications:

I have fix the validation to allow up to 255 length and changed '>b' range of -128 to 127 to '>B' which mean range of 0 to 255.

Result:

Tag length validation should now correctly support up to 255 characters.

@jell-o-fishi jell-o-fishi merged commit dfbd598 into rsocket:master Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants