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.

serve_dynamic.go 528B

1234567891011121314151617181920212223
  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. package public
  6. import (
  7. "io"
  8. "net/http"
  9. "os"
  10. "time"
  11. )
  12. func fileSystem(dir string) http.FileSystem {
  13. return http.Dir(dir)
  14. }
  15. // serveContent serve http content
  16. func serveContent(w http.ResponseWriter, req *http.Request, fi os.FileInfo, modtime time.Time, content io.ReadSeeker) {
  17. http.ServeContent(w, req, fi.Name(), modtime, content)
  18. }