rsocket / rsocket-cli

Command-line client for ReactiveSocket
Apache License 2.0
71 stars 22 forks source link

Add sanitization of uri to ensure a ws/wss uri is not malformed when passed as arg #68

Closed lksvenoy-r7 closed 5 years ago

lksvenoy-r7 commented 5 years ago

This PR fixes https://github.com/rsocket/rsocket-cli/issues/67

This makes the cli interface consistent with the usage for different protocols. While tcp://localhost:8765 would work ws://localhost:8080 would not work currently as the UriEndpointFactory in netty throws when / is not appended at the end. (A valid url would be ws://localhost:8080/)

This PR addresses this by intercepting the URI before it is passed to the client builder, and modifying the URI if the Path is empty and the scheme equals wss or ws.