-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If user formats rawURL to contain '#' before channel name - execution ends up in segfault #70
Comments
Yeah, since that is rocketchat specific, it should probably be handled inside the service (or rather, it's config parser), especially as this would prevent all other services from ever using the fragment part of the URLs. I guess we should either explicitly allow the fragment to be used as the channel name, or throw an error when we detect it, not do both. But otherwise I totally agree, getting a segfault for using the wrong syntax is terrible feedback for the consumer! |
Signed-off-by: Alexandru Bonini <[email protected]>
solved by #74 |
When I tried shoutrrr code for a rocket chat automated notification, and formatted the channel name with a '#' prefix - that is what I got:
It is pretty confusing given that it is caused by a '#' symbol. I've discovered it is caused by this statement in
pkg/services/rocketchat_configure.go:
Because path[3] in my case was empty. url.Parse red the path just until the '#' symbol.
Therefore, here are two possible remedies for this:
a) whether check at url.Parse() stage for escaped fragments (in pkg/router/router.go):
b) or check for escaped fragments just in rocket chat's case (if somebody is worrying about introducing bugs affecting other services):
(in pkg/services/rocketchat_configure.go:)
Let me know what you think, thanks.
The text was updated successfully, but these errors were encountered: