Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions messaging/topic_mgt.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

const (
iidEndpoint = "https://iid.googleapis.com/iid/v1"
iidSubscribe = ":batchAdd"
iidUnsubscribe = ":batchRemove"
iidSubscribe = "batchAdd"
iidUnsubscribe = "batchRemove"
)

var iidErrorCodes = map[string]struct{ Code, Msg string }{
Expand Down Expand Up @@ -164,7 +164,7 @@ func (c *iidClient) makeTopicManagementRequest(ctx context.Context, req *iidRequ

request := &internal.Request{
Method: http.MethodPost,
URL: fmt.Sprintf("%s/%s", c.iidEndpoint, req.op),
URL: fmt.Sprintf("%s:%s", c.iidEndpoint, req.op),
Body: internal.NewJSONEntity(req),
}
var result iidResponse
Expand Down
8 changes: 4 additions & 4 deletions messaging/topic_mgt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestSubscribe(t *testing.T) {
if err != nil {
t.Fatal(err)
}
client.iidEndpoint = ts.URL
client.iidEndpoint = ts.URL + "/v1"

resp, err := client.SubscribeToTopic(ctx, []string{"id1", "id2"}, "test-topic")
if err != nil {
Expand Down Expand Up @@ -84,7 +84,7 @@ func TestUnsubscribe(t *testing.T) {
if err != nil {
t.Fatal(err)
}
client.iidEndpoint = ts.URL
client.iidEndpoint = ts.URL + "/v1"

resp, err := client.UnsubscribeFromTopic(ctx, []string{"id1", "id2"}, "test-topic")
if err != nil {
Expand Down Expand Up @@ -125,7 +125,7 @@ func TestTopicManagementError(t *testing.T) {
if err != nil {
t.Fatal(err)
}
client.iidEndpoint = ts.URL
client.iidEndpoint = ts.URL + "/v1"
client.iidClient.httpClient.RetryConfig = nil

cases := []struct {
Expand Down Expand Up @@ -185,7 +185,7 @@ func checkIIDRequest(t *testing.T, b []byte, tr *http.Request, op string) {
if tr.Method != http.MethodPost {
t.Errorf("Method = %q; want = %q", tr.Method, http.MethodPost)
}
wantOp := "/" + op
wantOp := "/v1:" + op
if tr.URL.Path != wantOp {
t.Errorf("Path = %q; want = %q", tr.URL.Path, wantOp)
}
Expand Down