Fix API paths
MODIFY
appservice/api/query.go
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

MODIFY
eduserver/api/input.go
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) {

MODIFY
federationsender/api/perform.go
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 {

MODIFY
federationsender/api/query.go
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 {

MODIFY
internal/http/http.go
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

MODIFY
syncapi/api/query.go
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 {

Fix API paths