Fix godoc style comments (#356)

This commit is contained in:
Christian Muehlhaeuser
2020-11-13 00:14:59 +01:00
committed by GitHub
parent 8f921fbfde
commit 2e1f8d29b5
59 changed files with 147 additions and 147 deletions

View File

@@ -10,7 +10,7 @@ import (
"github.com/owncast/owncast/utils"
)
//DisableCache writes the disable cache header on the responses
// DisableCache writes the disable cache header on the responses.
func DisableCache(w http.ResponseWriter) {
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
w.Header().Set("Expires", "Thu, 1 Jan 1970 00:00:00 GMT")
@@ -21,7 +21,7 @@ func setCacheSeconds(seconds int, w http.ResponseWriter) {
w.Header().Set("Cache-Control", "public, max-age="+secondsStr)
}
// ProcessEtags gets and sets ETags for caching purposes
// ProcessEtags gets and sets ETags for caching purposes.
func ProcessEtags(w http.ResponseWriter, r *http.Request) int {
info, err := os.Stat(filepath.Join("webroot", r.URL.Path))
if err != nil {
@@ -40,7 +40,7 @@ func ProcessEtags(w http.ResponseWriter, r *http.Request) int {
return 0
}
// SetCachingHeaders will set the cache control header of a response
// SetCachingHeaders will set the cache control header of a response.
func SetCachingHeaders(w http.ResponseWriter, r *http.Request) {
setCacheSeconds(utils.GetCacheDurationSecondsForPath(r.URL.Path), w)
}

View File

@@ -4,7 +4,7 @@ import (
"net/http"
)
//EnableCors enables the cors header on the responses
// EnableCors enables the cors header on the responses.
func EnableCors(w *http.ResponseWriter) {
(*w).Header().Set("Access-Control-Allow-Origin", "*")
}