aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-05-22 14:14:39 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2020-05-22 14:14:39 +0100
commit06d5f1e6dcd9f3e1db92880c7c3f4068cc92ab99 (patch)
tree558ad5fe0d8b2d308085ef31aa45a144abde15cb
parent0978630b552b0f88bf5efc1c59860cbeb706606d (diff)
Fix API paths
-rw-r--r--appservice/api/query.go4
-rw-r--r--eduserver/api/input.go2
-rw-r--r--federationsender/api/perform.go6
-rw-r--r--federationsender/api/query.go4
-rw-r--r--internal/http/http.go10
-rw-r--r--syncapi/api/query.go8
6 files changed, 12 insertions, 22 deletions
diff --git a/appservice/api/query.go b/appservice/api/query.go
index 4a4e31a9..d36e138c 100644
--- a/appservice/api/query.go
+++ b/appservice/api/query.go
@@ -84,10 +84,10 @@ type AppServiceQueryAPI interface {
}
// AppServiceRoomAliasExistsPath is the HTTP path for the RoomAliasExists API
-const AppServiceRoomAliasExistsPath = "/api/appservice/RoomAliasExists"
+const AppServiceRoomAliasExistsPath = "/appservice/RoomAliasExists"
// AppServiceUserIDExistsPath is the HTTP path for the UserIDExists API
-const AppServiceUserIDExistsPath = "/api/appservice/UserIDExists"
+const AppServiceUserIDExistsPath = "/appservice/UserIDExists"
// httpAppServiceQueryAPI contains the URL to an appservice query API and a
// reference to a httpClient used to reach it
diff --git a/eduserver/api/input.go b/eduserver/api/input.go
index 999a5b41..8b5b6d76 100644
--- a/eduserver/api/input.go
+++ b/eduserver/api/input.go
@@ -55,7 +55,7 @@ type EDUServerInputAPI interface {
}
// EDUServerInputTypingEventPath is the HTTP path for the InputTypingEvent API.
-const EDUServerInputTypingEventPath = "/api/eduserver/input"
+const EDUServerInputTypingEventPath = "/eduserver/input"
// NewEDUServerInputAPIHTTP creates a EDUServerInputAPI implemented by talking to a HTTP POST API.
func NewEDUServerInputAPIHTTP(eduServerURL string, httpClient *http.Client) (EDUServerInputAPI, error) {
diff --git a/federationsender/api/perform.go b/federationsender/api/perform.go
index 427e7068..a73ba047 100644
--- a/federationsender/api/perform.go
+++ b/federationsender/api/perform.go
@@ -11,13 +11,13 @@ import (
const (
// FederationSenderPerformJoinRequestPath is the HTTP path for the PerformJoinRequest API.
- FederationSenderPerformDirectoryLookupRequestPath = "/api/federationsender/performDirectoryLookup"
+ FederationSenderPerformDirectoryLookupRequestPath = "/federationsender/performDirectoryLookup"
// FederationSenderPerformJoinRequestPath is the HTTP path for the PerformJoinRequest API.
- FederationSenderPerformJoinRequestPath = "/api/federationsender/performJoinRequest"
+ FederationSenderPerformJoinRequestPath = "/federationsender/performJoinRequest"
// FederationSenderPerformLeaveRequestPath is the HTTP path for the PerformLeaveRequest API.
- FederationSenderPerformLeaveRequestPath = "/api/federationsender/performLeaveRequest"
+ FederationSenderPerformLeaveRequestPath = "/federationsender/performLeaveRequest"
)
type PerformDirectoryLookupRequest struct {
diff --git a/federationsender/api/query.go b/federationsender/api/query.go
index bf58d5cc..4c0f757b 100644
--- a/federationsender/api/query.go
+++ b/federationsender/api/query.go
@@ -11,10 +11,10 @@ import (
)
// FederationSenderQueryJoinedHostsInRoomPath is the HTTP path for the QueryJoinedHostsInRoom API.
-const FederationSenderQueryJoinedHostsInRoomPath = "/api/federationsender/queryJoinedHostsInRoom"
+const FederationSenderQueryJoinedHostsInRoomPath = "/federationsender/queryJoinedHostsInRoom"
// FederationSenderQueryJoinedHostServerNamesInRoomPath is the HTTP path for the QueryJoinedHostServerNamesInRoom API.
-const FederationSenderQueryJoinedHostServerNamesInRoomPath = "/api/federationsender/queryJoinedHostServerNamesInRoom"
+const FederationSenderQueryJoinedHostServerNamesInRoomPath = "/federationsender/queryJoinedHostServerNamesInRoom"
// QueryJoinedHostsInRoomRequest is a request to QueryJoinedHostsInRoom
type QueryJoinedHostsInRoomRequest struct {
diff --git a/internal/http/http.go b/internal/http/http.go
index d0b4d6c5..77896a53 100644
--- a/internal/http/http.go
+++ b/internal/http/http.go
@@ -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
diff --git a/syncapi/api/query.go b/syncapi/api/query.go
index 6585bc09..1da05fcc 100644
--- a/syncapi/api/query.go
+++ b/syncapi/api/query.go
@@ -24,10 +24,10 @@ import (
)
const (
- SyncAPIQuerySyncPath = "/api/syncapi/querySync"
- SyncAPIQueryStatePath = "/api/syncapi/queryState"
- SyncAPIQueryStateTypePath = "/api/syncapi/queryStateType"
- SyncAPIQueryMessagesPath = "/api/syncapi/queryMessages"
+ SyncAPIQuerySyncPath = "/syncapi/querySync"
+ SyncAPIQueryStatePath = "/syncapi/queryState"
+ SyncAPIQueryStateTypePath = "/syncapi/queryStateType"
+ SyncAPIQueryMessagesPath = "/syncapi/queryMessages"
)
func NewSyncQueryAPIHTTP(syncapiURL string, httpClient *http.Client) SyncQueryAPI {