defaulting /assests switch to just look in the directory

This commit is contained in:
Vincent Batts 2013-08-05 18:39:52 -04:00
parent 931990614b
commit 81a51e78c9
1 changed files with 13 additions and 1 deletions

View File

@ -719,10 +719,22 @@ func routeAssets(w http.ResponseWriter, r *http.Request) {
return
}
w.Header().Set("Cache-Control", "max-age=315360000")
switch path {
case "bootstrap.css":
fmt.Fprintf(w, "%s", assets.BootstrapCss())
w.Header().Set("Cache-Control", "max-age=315360000")
w.Header().Set("Content-Type", "text/css")
case "bootstrap.js":
fmt.Fprintf(w, "%s", assets.BootstrapJs())
w.Header().Set("Content-Type", "application/javascript")
case "jquery.js":
fmt.Fprintf(w, "%s", assets.JqueryJs())
w.Header().Set("Content-Type", "application/javascript")
case "jqud.js":
fmt.Fprintf(w, "%s", assets.TagCloudJs())
w.Header().Set("Content-Type", "application/javascript")
default:
http.ServeFile(w,r,path)
}
}