Archived
Only create assets map on demand
This commit is contained in:
1 parent
1a6ac4aeb1
commit
e9c7970ea4
4 files changed
+65
-47
No files matched your search
@@ -652,6 +652,8 @@ func validAPIKey(k string) bool {
|
||||
}
|
||||
|
||||
func embeddedStatic(assetDir string) http.Handler {
|
||||
assets := auto.Assets()
|
||||
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
file := r.URL.Path
|
||||
|
||||
@@ -672,7 +674,7 @@ func embeddedStatic(assetDir string) http.Handler {
|
||||
}
|
||||
}
|
||||
|
||||
bs, ok := auto.Assets[file]
|
||||
bs, ok := assets[file]
|
||||
if !ok {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user