Fix godoc style comments (#356)
This commit is contained in:
committed by
GitHub
parent
8f921fbfde
commit
2e1f8d29b5
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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", "*")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user