code.gitea.io/gitea@v1.19.3/modules/public/serve_dynamic.go (about)

     1  // Copyright 2016 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  //go:build !bindata
     5  
     6  package public
     7  
     8  import (
     9  	"io"
    10  	"net/http"
    11  	"os"
    12  	"time"
    13  )
    14  
    15  func fileSystem(dir string) http.FileSystem {
    16  	return http.Dir(dir)
    17  }
    18  
    19  // serveContent serve http content
    20  func serveContent(w http.ResponseWriter, req *http.Request, fi os.FileInfo, modtime time.Time, content io.ReadSeeker) {
    21  	http.ServeContent(w, req, fi.Name(), modtime, content)
    22  }