Skip to content

Commit

Permalink
use redirect instead stream
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev committed Nov 22, 2023
1 parent 0f47aff commit 9454bb7
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"net"
"net/http"
"os"
"time"
Expand All @@ -17,17 +16,6 @@ func main() {

goCache := cache.New(5*time.Minute, 10*time.Minute)
bucketName := os.Getenv("BUCKET_NAME")
timeout := time.Duration(5) * time.Second
transport := &http.Transport{
ResponseHeaderTimeout: timeout,
Dial: func(network, addr string) (net.Conn, error) {
return net.DialTimeout(network, addr, timeout)
},
DisableKeepAlives: true,
}
client := &http.Client{
Transport: transport,
}
e := echo.New()

// Middleware
Expand All @@ -47,7 +35,7 @@ func main() {
return err
}

return streamFile(c, client, snapshot.Filename, snapshot.URL)
return c.Redirect(http.StatusFound, snapshot.URL)
}
}
api := func(c echo.Context) error {
Expand Down

0 comments on commit 9454bb7

Please sign in to comment.