From 43aa31cf9c245ffe13bf63bcf9d364495fddb2d6 Mon Sep 17 00:00:00 2001 From: Sunny Beatteay Date: Thu, 23 Aug 2018 14:16:04 -0400 Subject: [PATCH] storage: fix cdn flush cache cdn endpoint and fix changelog --- CHANGELOG.md | 6 +++++- cdn.go | 2 +- cdn_test.go | 2 +- godo.go | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ee72e70..b2ca55b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ # Change Log +## [v1.4.1] - 2018-08-23 + +- #176 Fix cdn flush cache API endpoint - @sunny-b + ## [v1.4.0] - 2018-08-22 -- #170 Add support for Spaces CDN - @sunny-b +- #175 Add support for Spaces CDN - @sunny-b ## [v1.3.0] - 2018-05-24 diff --git a/cdn.go b/cdn.go index 980c4bd0..217d90e5 100644 --- a/cdn.go +++ b/cdn.go @@ -164,7 +164,7 @@ func (c CDNServiceOp) FlushCache(ctx context.Context, id string, flushCacheReque return nil, NewArgError("id", "cannot be an empty string") } - path := fmt.Sprintf("%s/%s", cdnBasePath, id) + path := fmt.Sprintf("%s/%s/cache", cdnBasePath, id) req, err := c.client.NewRequest(ctx, http.MethodDelete, path, flushCacheRequest) if err != nil { diff --git a/cdn_test.go b/cdn_test.go index 9d35adce..318962bd 100644 --- a/cdn_test.go +++ b/cdn_test.go @@ -278,7 +278,7 @@ func TestCDN_FluchCacheCDN(t *testing.T) { setup() defer teardown() - mux.HandleFunc("/v2/cdn/endpoints/12345", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/v2/cdn/endpoints/12345/cache", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodDelete) }) diff --git a/godo.go b/godo.go index 12eb11c6..f288995a 100644 --- a/godo.go +++ b/godo.go @@ -18,7 +18,7 @@ import ( ) const ( - libraryVersion = "1.4.0" + libraryVersion = "1.4.1" defaultBaseURL = "https://api.digitalocean.com/" userAgent = "godo/" + libraryVersion mediaType = "application/json"