Skip to content

Commit f416190

Browse files
committed
Test to ensure url-encoded paths are handled.
URL-encoded paths should be handled transparently, but let's be affirmative about it, especially since the colon character has the potential to be troublesome in some situations.
1 parent 0a0e1a2 commit f416190

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

pkg/app/app_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,20 @@ func TestWaitOperatioSucceeds(t *testing.T) {
152152
}
153153
}
154154

155+
func TestWaitOperationUrlEncodedSucceeds(t *testing.T) {
156+
controller := NewApp(&testInstanceManager{}, &testAccountManager{}, nil, nil, nil, "", nil, apiv1.InfraConfig{}, &config.Config{})
157+
ts := httptest.NewServer(controller.Handler())
158+
defer ts.Close()
159+
160+
res, _ := http.Post(
161+
ts.URL+"/v1/zones/us-central1-a/operations/foo/%3Await", "application/json", strings.NewReader("{}"))
162+
163+
expected := http.StatusOK
164+
if res.StatusCode != expected {
165+
t.Errorf("unexpected status code <<%d>>, want: %d", res.StatusCode, expected)
166+
}
167+
}
168+
155169
func TestBuildListHostsRequest(t *testing.T) {
156170

157171
t.Run("default", func(t *testing.T) {

0 commit comments

Comments
 (0)