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 636B

123456789101112131415161718192021222324
  1. // +build !bindata
  2. // Copyright 2016 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package public
  6. import (
  7. "io"
  8. "net/http"
  9. "os"
  10. "time"
  11. )
  12. // Static implements the macaron static handler for serving assets.
  13. func Static(opts *Options) func(next http.Handler) http.Handler {
  14. return opts.staticHandler(opts.Directory)
  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. }