Browse Source

Update requests dependency

master
Jan-Lukas Else 2 weeks ago
parent
commit
d6518c3a5d
  1. 2
      go.mod
  2. 4
      go.sum
  3. 7
      mediaCompression.go
  4. 3
      ntfy.go
  5. 3
      tts.go
  6. 2
      webmentionSending.go

2
go.mod

@ -11,7 +11,7 @@ require (
github.com/alecthomas/chroma v0.9.4
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/c2h5oh/datasize v0.0.0-20200825124411-48ed595a09d2
github.com/carlmjohnson/requests v0.21.13
github.com/carlmjohnson/requests v0.22.1
github.com/cretz/bine v0.2.0
github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f
github.com/dgraph-io/ristretto v0.1.0

4
go.sum

@ -65,8 +65,8 @@ github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/c2h5oh/datasize v0.0.0-20200825124411-48ed595a09d2 h1:t8KYCwSKsOEZBFELI4Pn/phbp38iJ1RRAkDFNin1aak=
github.com/c2h5oh/datasize v0.0.0-20200825124411-48ed595a09d2/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M=
github.com/carlmjohnson/requests v0.21.13 h1:p9DiBwbrLG8uA67YPOrfGMG1ZRzRyPBaO9hXQpX+Ork=
github.com/carlmjohnson/requests v0.21.13/go.mod h1:Hw4fFOk3xDlHQbNRTGo4oc52TUTpVEq93sNy/H+mrQM=
github.com/carlmjohnson/requests v0.22.1 h1:YoifpEbpJW4LPRX/+0dJe3vTLducEE9Ib10k6lElIUM=
github.com/carlmjohnson/requests v0.22.1/go.mod h1:Hw4fFOk3xDlHQbNRTGo4oc52TUTpVEq93sNy/H+mrQM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=

7
mediaCompression.go

@ -63,7 +63,7 @@ func (sp *shortpixel) compress(url string, upload mediaStorageSaveFunc, hc *http
err := requests.
URL("https://api.shortpixel.com/v2/reducer-sync.php").
Client(hc).
Post().
Method(http.MethodPost).
BodyJSON(map[string]interface{}{
"key": sp.key,
"plugin_version": "GB001",
@ -100,7 +100,7 @@ func (tf *tinify) compress(url string, upload mediaStorageSaveFunc, hc *http.Cli
err := requests.
URL("https://api.tinify.com/shrink").
Client(hc).
Post().
Method(http.MethodPost).
BasicAuth("api", tf.key).
BodyJSON(map[string]interface{}{
"source": map[string]interface{}{
@ -124,7 +124,7 @@ func (tf *tinify) compress(url string, upload mediaStorageSaveFunc, hc *http.Cli
err = requests.
URL(compressedLocation).
Client(hc).
Post().
Method(http.MethodPost).
BasicAuth("api", tf.key).
BodyJSON(map[string]interface{}{
"resize": map[string]interface{}{
@ -157,7 +157,6 @@ func (cf *cloudflare) compress(url string, upload mediaStorageSaveFunc, hc *http
err := requests.
URL(fmt.Sprintf("https://www.cloudflare.com/cdn-cgi/image/f=jpeg,q=75,metadata=none,fit=scale-down,w=%d,h=%d/%s", defaultCompressionWidth, defaultCompressionHeight, url)).
Client(hc).
Get().
ToBytesBuffer(&imgBuffer).
Fetch(context.Background())
if err != nil {

3
ntfy.go

@ -2,6 +2,7 @@ package main
import (
"context"
"net/http"
"strings"
"github.com/carlmjohnson/requests"
@ -22,7 +23,7 @@ func (a *goBlog) sendNtfy(cfg *configNtfy, msg string) error {
URL(cfg.Topic).
Client(a.httpClient).
UserAgent(appUserAgent).
Post().
Method(http.MethodPost).
BodyReader(strings.NewReader(msg)).
Fetch(context.Background())
}

3
tts.go

@ -8,6 +8,7 @@ import (
"html"
"io"
"log"
"net/http"
"net/url"
"path"
"strings"
@ -177,7 +178,7 @@ func (a *goBlog) createTTSAudio(lang, ssml string, w io.Writer) error {
Param("key", gctts.GoogleAPIKey).
Client(a.httpClient).
UserAgent(appUserAgent).
Post().
Method(http.MethodPost).
BodyJSON(body).
ToJSON(&response).
Fetch(context.Background())

2
webmentionSending.go

@ -73,7 +73,7 @@ func (a *goBlog) sendWebmentions(p *post) error {
func (a *goBlog) sendWebmention(endpoint, source, target string) error {
// TODO: Pass all tests from https://webmention.rocks/
return requests.URL(endpoint).Client(a.httpClient).Post().UserAgent(appUserAgent).
return requests.URL(endpoint).Client(a.httpClient).Method(http.MethodPost).UserAgent(appUserAgent).
BodyForm(url.Values{
"source": []string{source},
"target": []string{target},

Loading…
Cancel
Save