sockjs-go
sockjs-go copied to clipboard
Handler prefix does not allow grouping expressions
Creating a sockjs handler with a prefix that involves a regular expression group breaks parseSessionID
because it uses constant match offsets.
It feels like there are two options:
- Trim the prefix-match from the incoming
url.Path
before attempting the session match. - Take advantage of the named matches (assuming the user-provided prefix does not include the same names).
In my situation, I have two prefix paths that I want to be treated equivalently. Let's call them:
/foo/bar
/foo
I am attempting to adjust the client, but that's a little out of my control; I originally tried to work around this situation with:
sockjs.NewHandler(
"/foo(/bar)?",
...
)