From d568654df101bfc2fc1fb2f6491925cde5ec8f20 Mon Sep 17 00:00:00 2001 From: Soulcramer Date: Sat, 2 Mar 2019 23:45:02 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20the=20"url=20must=20not?= =?UTF-8?q?=20contain=20a=20query=20string"=20error=20when=20requesting=20?= =?UTF-8?q?the=20user=20from=20twitter=20API.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This error was throw by the oauth lib, we had to pass the params as a parameter of the `Get` method. --- auth/twitter.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/auth/twitter.go b/auth/twitter.go index d61ddf8b..26976cf0 100644 --- a/auth/twitter.go +++ b/auth/twitter.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "net/http" + "net/url" "strings" "github.com/aerogo/aero" @@ -79,7 +80,8 @@ func InstallTwitterAuth(app *aero.Application) { } // Fetch user data from Twitter - resp, err := config.Get(nil, tokenCred, "https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true&skip_status=true", nil) + params := url.Values{"include_email": {"true"}, "skip_status": {"true"}} + resp, err := config.Get(nil, tokenCred, "https://api.twitter.com/1.1/account/verify_credentials.json", params) if err != nil { return ctx.Error(http.StatusBadRequest, "Failed requesting user data from Twitter", err)