diff options
author | Wim <wim@42.be> | 2022-08-13 16:14:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-13 16:14:26 +0200 |
commit | 6a3fc713978a0c1c9290a4afd08b47886b49b635 (patch) | |
tree | aa62cd85cf5671646c75ee38b3fc140ef7edcea8 /vendor/github.com/SevereCloud/vksdk/v2/api/api.go | |
parent | 3c4192ebf6a32e30cdd23a9644c2ceca72a006fa (diff) | |
download | matterbridge-msglm-6a3fc713978a0c1c9290a4afd08b47886b49b635.tar.gz matterbridge-msglm-6a3fc713978a0c1c9290a4afd08b47886b49b635.tar.bz2 matterbridge-msglm-6a3fc713978a0c1c9290a4afd08b47886b49b635.zip |
Update dependencies and go1.18 (#1873)
* Update dependencies and go1.18
* Exclude unnecessary linters and update build to go1.18
Diffstat (limited to 'vendor/github.com/SevereCloud/vksdk/v2/api/api.go')
-rw-r--r-- | vendor/github.com/SevereCloud/vksdk/v2/api/api.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/api.go b/vendor/github.com/SevereCloud/vksdk/v2/api/api.go index dfc4afaf..c1fb3dea 100644 --- a/vendor/github.com/SevereCloud/vksdk/v2/api/api.go +++ b/vendor/github.com/SevereCloud/vksdk/v2/api/api.go @@ -203,10 +203,13 @@ func buildQuery(sliceParams ...Params) (context.Context, url.Values) { for _, params := range sliceParams { for key, value := range params { - if key != ":context" { - query.Set(key, FmtValue(value, 0)) - } else { + switch key { + case "access_token": + continue + case ":context": ctx = value.(context.Context) + default: + query.Set(key, FmtValue(value, 0)) } } } @@ -255,6 +258,9 @@ func (vk *VK) DefaultHandler(method string, sliceParams ...Params) (Response, er acceptEncoding = "zstd" } + token := sliceParams[len(sliceParams)-1]["access_token"].(string) + req.Header.Set("Authorization", "Bearer "+token) + req.Header.Set("User-Agent", vk.UserAgent) req.Header.Set("Content-Type", "application/x-www-form-urlencoded") |