实现gzip

This commit is contained in:
刘祥超
2020-09-29 17:21:46 +08:00
parent c8ed2f59be
commit 4218221e1c
3 changed files with 64 additions and 11 deletions

View File

@@ -151,7 +151,7 @@ func (this *HTTPRequest) doRoot() (isBreak bool) {
// mime type
if this.web.ResponseHeaderPolicy == nil || !this.web.ResponseHeaderPolicy.IsOn || !this.web.ResponseHeaderPolicy.ContainsHeader("CONTENT-TYPE") {
ext := filepath.Ext(requestPath)
ext := filepath.Ext(filePath)
if len(ext) > 0 {
mimeType := mime.TypeByExtension(ext)
if len(mimeType) > 0 {