slack icon indicating copy to clipboard operation
slack copied to clipboard

Remove url.QueryUnescape for blocks in the slacktest postMessageHandler

Open bincyber opened this issue 3 years ago • 2 comments

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().

bincyber avatar May 11 '22 23:05 bincyber

Thanks. I have one concern, so please be patient...

kanata2 avatar Jun 06 '22 00:06 kanata2

I just encountered this issue - any update on this?

Kuroshii avatar Oct 05 '22 18:10 Kuroshii

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

bincyber avatar Apr 25 '24 07:04 bincyber