Skip to content

Wrong maximum length of route metadata #170

@GooDer

Description

@GooDer

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.

Expected Behavior

Metadata tag should allow to be up to 255 character long

Actual Behavior

Maximum metadata length is now 127 characters

Steps to Reproduce

See unit test in #169

Possible Solution

Already created PR with fix #169

Your Environment

Tried on Linux with Python 3.8 and Windows with Python 3.11

  • RSocket version(s) used: 0.4.11

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions