2016-11-29 17:26:36 +01:00
|
|
|
// Copyright 2016 The Gitea Authors. All rights reserved.
|
2022-11-27 13:20:29 -05:00
|
|
|
// SPDX-License-Identifier: MIT
|
2016-11-29 17:26:36 +01:00
|
|
|
|
2021-08-24 11:47:09 -05:00
|
|
|
//go:build !bindata
|
|
|
|
|
|
2016-11-29 17:26:36 +01:00
|
|
|
package public
|
|
|
|
|
|
2020-12-24 12:25:17 +08:00
|
|
|
import (
|
|
|
|
|
"io"
|
|
|
|
|
"net/http"
|
|
|
|
|
"os"
|
|
|
|
|
"time"
|
|
|
|
|
)
|
2016-11-29 17:26:36 +01:00
|
|
|
|
2021-05-30 18:25:11 +08:00
|
|
|
func fileSystem(dir string) http.FileSystem {
|
|
|
|
|
return http.Dir(dir)
|
2016-11-29 17:26:36 +01:00
|
|
|
}
|
2020-12-24 12:25:17 +08:00
|
|
|
|
2021-05-30 18:25:11 +08:00
|
|
|
// serveContent serve http content
|
|
|
|
|
func serveContent(w http.ResponseWriter, req *http.Request, fi os.FileInfo, modtime time.Time, content io.ReadSeeker) {
|
2020-12-24 12:25:17 +08:00
|
|
|
http.ServeContent(w, req, fi.Name(), modtime, content)
|
|
|
|
|
}
|