Skip to content

Commit

Permalink
Merge pull request #47 from chhsiao1981/cache-control
Browse files Browse the repository at this point in the history
cache-control in processCSRFContent
  • Loading branch information
chhsiao1981 authored Jan 1, 2021
2 parents 46b16b6 + f8de402 commit 5a45101
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/api_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -117,7 +118,7 @@ func processCSRFContent(filename string, c *gin.Context) {
csrfToken, err := createCSRFToken()
content = strings.Replace(content, "__CSRFTOKEN__", csrfToken, 1)

c.Header("Cache-Control", "max-age=")
c.Header("Cache-Control", "max-age="+strconv.Itoa(types.CSRF_TOKEN_TS))

processStringResult(c, content, mimeType)
}

0 comments on commit 5a45101

Please sign in to comment.