Skip to content

Commit

Permalink
fix: do not uses url.JoinPath for strava api
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <git@mattglei.ch>
  • Loading branch information
gleich committed Dec 1, 2024
1 parent 5c06654 commit ee72428
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions internal/apis/strava/api.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
package strava

import (
"fmt"
"net/http"
"net/url"

"github.com/gleich/lcp-v2/internal/apis"
"github.com/gleich/lumber/v3"
)

func sendStravaAPIRequest[T any](path string, tokens tokens) (T, error) {
var zeroValue T
u, err := url.JoinPath("https://www.strava.com/", path)
if err != nil {
lumber.Error(err, "failed to join URL")
return zeroValue, err
}

req, err := http.NewRequest("GET", u, nil)
req, err := http.NewRequest("GET", fmt.Sprintf("https://www.strava.com/%s", path), nil)
if err != nil {
lumber.Error(err, "failed to create request")
return zeroValue, err
Expand Down

0 comments on commit ee72428

Please sign in to comment.