Skip to content

Commit

Permalink
Fix url for download handler (#3)
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Chacin <[email protected]>
  • Loading branch information
pablochacin authored Jul 4, 2024
1 parent 6ecf25f commit cf0a438
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cache_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewCacheServer(config CacheServerConfig) http.Handler {
// FIXME: this should be PUT (used POST as http client doesn't have PUT method)
handler.HandleFunc("POST /{id}", cacheSrv.Store)
handler.HandleFunc("GET /{id}", cacheSrv.Get)
handler.HandleFunc("GET /{id}/content", cacheSrv.Download)
handler.HandleFunc("GET /{id}/download", cacheSrv.Download)

return handler
}
Expand Down
2 changes: 1 addition & 1 deletion cache_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func TestCacheServerDownload(t *testing.T) {
t.Run(tc.title, func(t *testing.T) {
t.Parallel()

url := fmt.Sprintf("%s/%s/content", srv.URL, tc.id)
url := fmt.Sprintf("%s/%s/download", srv.URL, tc.id)
resp, err := http.Get(url)
if err != nil {
t.Fatalf("accessing server %v", err)
Expand Down

0 comments on commit cf0a438

Please sign in to comment.