mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -5,8 +5,9 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/photoprism/photoprism/pkg/header"
|
||||
)
|
||||
|
||||
func TestAddVideoCacheHeader(t *testing.T) {
|
||||
@@ -15,7 +16,7 @@ func TestAddVideoCacheHeader(t *testing.T) {
|
||||
c, _ := gin.CreateTestContext(r)
|
||||
AddVideoCacheHeader(c, true)
|
||||
h := r.Header()
|
||||
s := h["Cache-Control"][0]
|
||||
s := h[header.CacheControl][0]
|
||||
assert.Equal(t, "public, max-age=21600, immutable", s)
|
||||
})
|
||||
t.Run("Private", func(t *testing.T) {
|
||||
@@ -23,7 +24,7 @@ func TestAddVideoCacheHeader(t *testing.T) {
|
||||
c, _ := gin.CreateTestContext(r)
|
||||
AddVideoCacheHeader(c, false)
|
||||
h := r.Header()
|
||||
s := h["Cache-Control"][0]
|
||||
s := h[header.CacheControl][0]
|
||||
assert.Equal(t, "private, max-age=21600, immutable", s)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user