Add 10min public cache to HTTP server

pull/69/head
Thomas Buckley-Houston 2018-06-25 22:06:29 +08:00
rodzic c549f74bf5
commit 2e1de9dab1
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -60,6 +60,7 @@ func (h *slashFix) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func handleHTTPServerRequest(w http.ResponseWriter, r *http.Request) {
var message string
urlForBrowsh, _ := url.PathUnescape(strings.TrimPrefix(r.URL.Path, "/"))
w.Header().Set("Cache-Control", "public, max-age=600")
if strings.TrimSpace(urlForBrowsh) == "" {
if (strings.Contains(r.Host, "text.")) {
message = "Welcome to the Browsh plain text client.\n" +