Merge pull request #176 from sunny-b/master

Storage: fix cdn flush cache endpoint and fix changelog
This commit is contained in:
Maurício Linhares 2018-08-23 14:38:25 -04:00 committed by GitHub
commit ddc940d8ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View File

@ -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

2
cdn.go
View File

@ -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 {

View File

@ -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)
})

View File

@ -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"