Skip to content

Commit

Permalink
feat: Etag use md5 hash
Browse files Browse the repository at this point in the history
  • Loading branch information
pupilcc committed Jan 8, 2024
1 parent d3361a1 commit aa28a58
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ package main
import (
"autossl/middleware"
"autossl/web"
"crypto/md5"
"github.com/golang-jwt/jwt/v5"
echojwt "github.com/labstack/echo-jwt/v4"
"github.com/labstack/echo/v4"
etag "github.com/pablor21/echo-etag/v4"
"hash"
"net/http"
"os"
)
Expand Down Expand Up @@ -45,7 +47,12 @@ func main() {
e.Use(AllowHeadRequestsMiddleware())

// Etag
e.Use(etag.Etag())
e.Use(etag.WithConfig(etag.Config{
Weak: true,
HashFn: func(config etag.Config) hash.Hash {
return md5.New()
},
}))

// Start the service
e.Logger.Fatal(e.Start(":1323"))
Expand Down

0 comments on commit aa28a58

Please sign in to comment.