Remove url.QueryUnescape for blocks in the slacktest postMessageHandler
Pull Request Guidelines
These are recommendations for pull requests. They are strictly guidelines to help manage expectations.
PR preparation
Run make pr-prep from the root of the repository to run formatting, linting and tests.
Should this be an issue instead
- [ ] is it a convenience method? (no new functionality, streamlines some use case)
- [ ] exposes a previously private type, const, method, etc.
- [ ] is it application specific (caching, retry logic, rate limiting, etc)
- [ ] is it performance related.
Description
The postMessageHandler in the slacktest package is attempting to query unescape the contents of blocks. When posting a message that contains %, for example:
{
"blocks": [{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "You've scored 100%!"
}
}]
}
This results in the following error: Unable to decode blocks: invalid URL escape "%!(BADWIDTH)%! (MISSING)"
Since the blocks can be unmarshalled to json without having to query unescape it, I've removed the use of url.QueryUnescape().
Thanks. I have one concern, so please be patient...
I just encountered this issue - any update on this?
So it's been almost 2 years since I've opened this PR. I'll be closing it and you can reopen it if you wish