mirror of
https://github.com/Luzifer/cloudkeys-go.git
synced 2024-11-08 14:10:05 +00:00
Fix request without filename
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
9bd560a05a
commit
b0ff38946d
1 changed files with 6 additions and 1 deletions
|
@ -8,7 +8,12 @@ import (
|
|||
)
|
||||
|
||||
func serveAssets(res http.ResponseWriter, r *http.Request) {
|
||||
data, err := Asset(path.Join("dist", r.RequestURI[1:]))
|
||||
var fileName = r.RequestURI[1:]
|
||||
if fileName == "" {
|
||||
fileName = "index.html"
|
||||
}
|
||||
|
||||
data, err := Asset(path.Join("dist", fileName))
|
||||
if err != nil {
|
||||
http.Error(res, "Not found", http.StatusNotFound)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue