aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/handlers/fs.go
diff options
context:
space:
mode:
authorSamuel Johnson <[email protected]>2025-11-25 20:52:35 -0500
committerSamuel Johnson <[email protected]>2025-11-25 20:52:35 -0500
commit44d6620b32f31c04663c9e08a1c3954273230ee8 (patch)
treea87cf977313ec95f050d7cdbbebd8bdae7c00ab2 /cmd/web/handlers/fs.go
parent12602302f28478a9e4ef91e66f68347a4d76f8a6 (diff)
Tidy the code
Diffstat (limited to 'cmd/web/handlers/fs.go')
-rw-r--r--cmd/web/handlers/fs.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/cmd/web/handlers/fs.go b/cmd/web/handlers/fs.go
index 96f11d0..1a68e35 100644
--- a/cmd/web/handlers/fs.go
+++ b/cmd/web/handlers/fs.go
@@ -9,9 +9,9 @@ import (
)
type fsContext struct {
- err *log.Logger
- path string
- contentType string
+ err *log.Logger
+ path string
+ contentType string
}
func (ctx *fsContext) readdir(w http.ResponseWriter, r *http.Request) {
@@ -45,14 +45,14 @@ func (ctx *fsContext) get(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", ctx.contentType)
} else {
switch filepath.Ext(name) {
- case ".css":
- w.Header().Set("Content-Type", "text/css")
- case ".js":
- w.Header().Set("Content-Type", "text/javascript")
- case ".svg":
- w.Header().Set("Content-Type", "image/svg+xml")
- case ".png":
- w.Header().Set("Content-Type", "image/png")
+ case ".css":
+ w.Header().Set("Content-Type", "text/css")
+ case ".js":
+ w.Header().Set("Content-Type", "text/javascript")
+ case ".svg":
+ w.Header().Set("Content-Type", "image/svg+xml")
+ case ".png":
+ w.Header().Set("Content-Type", "image/png")
}
}