From ea5eb8b371d87a6dd428321b01ef30a6c4d0910e Mon Sep 17 00:00:00 2001 From: 3405691582 Date: Thu, 19 Mar 2026 13:02:16 +0000 Subject: [PATCH] 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. --- pkg/app/app_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/app/app_test.go b/pkg/app/app_test.go index d5407e98..af0548d1 100644 --- a/pkg/app/app_test.go +++ b/pkg/app/app_test.go @@ -152,6 +152,20 @@ func TestWaitOperatioSucceeds(t *testing.T) { } } +func TestWaitOperationUrlEncodedSucceeds(t *testing.T) { + controller := NewApp(&testInstanceManager{}, &testAccountManager{}, nil, nil, nil, "", nil, apiv1.InfraConfig{}, &config.Config{}) + ts := httptest.NewServer(controller.Handler()) + defer ts.Close() + + res, _ := http.Post( + ts.URL+"/v1/zones/us-central1-a/operations/foo/%3Await", "application/json", strings.NewReader("{}")) + + expected := http.StatusOK + if res.StatusCode != expected { + t.Errorf("unexpected status code <<%d>>, want: %d", res.StatusCode, expected) + } +} + func TestBuildListHostsRequest(t *testing.T) { t.Run("default", func(t *testing.T) {