mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
improve resource feature in ghttp.Server
This commit is contained in:
@ -8,8 +8,8 @@ import (
|
||||
|
||||
func main() {
|
||||
// 创建一个默认的gmap对象,
|
||||
// 默认情况下该gmap对象支持并发安全特性,
|
||||
// 初始化时可以给定false参数关闭并发安全特性,当做一个普通的map使用。
|
||||
// 默认情况下该gmap对象不支持并发安全特性,
|
||||
// 初始化时可以给定true参数关闭并发安全特性,当做一个普通的map使用。
|
||||
m := gmap.New()
|
||||
|
||||
// 设置键值对
|
||||
|
||||
@ -284,7 +284,7 @@ func (s *Server) listDir(r *Request, f http.File) {
|
||||
}
|
||||
r.Response.Write(`<tr>`)
|
||||
r.Response.Writef(`<td><a href="%s/%s">%s</a></td>`, r.URL.Path, name, ghtml.SpecialChars(name))
|
||||
r.Response.Writef(`<td>%s</td>`, gtime.New(file.ModTime()).ISO8601())
|
||||
r.Response.Writef(`<td style="width:300px;text-align:center;">%s</td>`, gtime.New(file.ModTime()).ISO8601())
|
||||
r.Response.Writef(`<td style="width:80px;text-align:center;">%s</td>`, size)
|
||||
r.Response.Write(`</tr>`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user