Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

URL-Encode request path #207

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

URL-Encode request path #207

wants to merge 3 commits into from

Conversation

MineBartekSA
Copy link

The request path should be URL-Encoded.
This change allows writing code like:

client.create_reaction(<channel id>, <message id>, "⏭")

Now nobody has to keep track of emojis and such.

Copy link
Contributor

@greenbigfrog greenbigfrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm otherwise 👍

src/discordcr/rest.cr Outdated Show resolved Hide resolved
Co-authored-by: Jonathan <greenbigfrog@gmail.com>
@z64
Copy link
Contributor

z64 commented May 7, 2020

I'm not sure this should happen at our base request method. It will be redundant in 99% of cases - emoji are the exception where we need to assert that the content is encoded correctly - so I think it might be better to localize this to the relevant REST methods to optimize that path in the simplest way.

@MineBartekSA
Copy link
Author

I've only added URI.encode to the relevant request paths.

PixeLInc pushed a commit to sledgang/discordcr that referenced this pull request Nov 1, 2020
PixeLInc pushed a commit to shardlab/discordcr that referenced this pull request Nov 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants