mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 19:48:21 +00:00
move version to package
This commit is contained in:
@@ -4,11 +4,10 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/drone/drone/version"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var version string
|
||||
|
||||
// NoCache is a middleware function that appends headers
|
||||
// to prevent the client from caching the HTTP response.
|
||||
func NoCache(c *gin.Context) {
|
||||
@@ -52,10 +51,7 @@ func Secure(c *gin.Context) {
|
||||
// Version is a middleware function that appends the Drone
|
||||
// version information to the HTTP response. This is intended
|
||||
// for debugging and troubleshooting.
|
||||
func Version(version string) gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
c.Set("version", "0.4.0-beta+"+version)
|
||||
c.Header("X-DRONE-VERSION", "0.4.0-beta+"+version)
|
||||
c.Next()
|
||||
}
|
||||
func Version(c *gin.Context) {
|
||||
c.Header("X-DRONE-VERSION", version.Version)
|
||||
c.Next()
|
||||
}
|
||||
|
Reference in New Issue
Block a user