hoijui / JavaOSC

OSC content format/"protocol" library for JVM languages
http://www.illposed.com/software/javaosc.html
BSD 3-Clause "New" or "Revised" License
156 stars 43 forks source link

OSCMessage and invalid addresses #67

Open BryanEnneking opened 2 years ago

BryanEnneking commented 2 years ago

I believe there is an inconsistency between the spec and the implementation of invalid address checking on messages. In short, the characters '*', ',', '?', '[', ']', '{', '}' should all be allowed in the address. Where these characters are not allowed is in method names (i.e. addresses implemented on the server). An OSC client is allowed to send addresses containing these characters for the purpose of wildcarding and pattern matching. The server then interprets these patterns in order to invoke multiple methods. Therefore, OSCMessage should allow addresses with these characters. Currently, an exception is thrown whenever these characters are in the address. There does not appear to be a way around this. Maybe these characters should be removed from the ILLEGAL_ADDRESS_CHAR regular expression or a constructor could be provided that allows checkAddress to be false.

Here are the relevant links to the spec: Method Matching Example

Thanks!

BryanEnneking commented 2 years ago

Also, I'm happy to make the change if others are in agreement with it.

dkgof commented 1 year ago

I agree, those characters should be allowed according to spec.

hoijui commented 4 months ago

I would accept a PR (sorry, have no time for working on this myself)