You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dynamic.go 547B

123456789101112131415161718192021222324
  1. // Copyright 2016 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. //go:build !bindata
  5. // +build !bindata
  6. package public
  7. import (
  8. "io"
  9. "net/http"
  10. "os"
  11. "time"
  12. )
  13. func fileSystem(dir string) http.FileSystem {
  14. return http.Dir(dir)
  15. }
  16. // serveContent serve http content
  17. func serveContent(w http.ResponseWriter, req *http.Request, fi os.FileInfo, modtime time.Time, content io.ReadSeeker) {
  18. http.ServeContent(w, req, fi.Name(), modtime, content)
  19. }