Commit 5a4cc60a authored by Brian Lindner's avatar Brian Lindner

Now properly escaping URLs (whoops)

parent 95935f6f
......@@ -8,6 +8,7 @@ import (
"github.com/tidwall/gjson" // for getting items in dot notation
"io/ioutil" // for opening response body
"net/http"
"net/url"
"regexp"
)
......@@ -90,7 +91,7 @@ func (r RESTCommand) Run(bot *discordgo.Session, evt *discordgo.MessageCreate) (
rgxgroups := r.regexp.FindAllStringSubmatch(evt.Message.Content, -1)[0]
var reqfmtgroups []interface{}
for _, i := range r.endpointgroups {
reqfmtgroups = append(reqfmtgroups, rgxgroups[i])
reqfmtgroups = append(reqfmtgroups, url.QueryEscape(rgxgroups[i]))
}
endpoint := fmt.Sprintf(r.endpointstring, reqfmtgroups...)
// Construct request based on this endpoint
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment