mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-30 04:52:46 +00:00
Fix API paths
This commit is contained in:
parent
0978630b55
commit
06d5f1e6dc
6 changed files with 12 additions and 22 deletions
|
@ -6,8 +6,6 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
"github.com/opentracing/opentracing-go/ext"
|
||||
|
@ -23,14 +21,6 @@ func PostJSON(
|
|||
return err
|
||||
}
|
||||
|
||||
parsedAPIURL, err := url.Parse(apiURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
parsedAPIURL.Path = "/api/" + strings.TrimLeft(parsedAPIURL.Path, "/")
|
||||
apiURL = parsedAPIURL.String()
|
||||
|
||||
req, err := http.NewRequest(http.MethodPost, apiURL, bytes.NewReader(jsonBytes))
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue