~blu/artemis

d01a000ed5867a9ad655c10188ad1dd7e9d5510b — Bryant Conquest 10 months ago 864fec9 main
run gofumpt
1 files changed, 5 insertions(+), 5 deletions(-)

M main.go
M main.go => main.go +5 -5
@@ 5,10 5,10 @@ import (
	"expvar"
	"fmt"
	"log"
	"mime"
	"net/http"
	"path/filepath"
	"strings"
  "path/filepath"
  "mime"

	"tailscale.com/tsweb"



@@ 60,9 60,9 @@ func AssetHandler(h *Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		path := strings.TrimLeft(r.URL.Path, "/assets")

    if ext := mime.TypeByExtension(filepath.Ext(path)); ext != "" {
      w.Header().Set("Content-Type", ext)
    }
		if ext := mime.TypeByExtension(filepath.Ext(path)); ext != "" {
			w.Header().Set("Content-Type", ext)
		}

		etag := r.Header.Get("If-None-Match")
		_, ok := h.Cache.Files.Load(etag)