实现Web静态文件分发

This commit is contained in:
GoEdgeLab
2020-09-26 11:22:21 +08:00
parent 320ed5a1b6
commit fb786059b3
8 changed files with 323 additions and 35 deletions

View File

@@ -4,7 +4,7 @@ import (
"net/http"
)
func (this *HTTPRequest) writeNotFoundError() {
func (this *HTTPRequest) write404() {
if this.doPage(http.StatusNotFound) {
return
}
@@ -17,7 +17,7 @@ func (this *HTTPRequest) writeNotFoundError() {
_, _ = this.writer.Write([]byte(msg))
}
func (this *HTTPRequest) writeInternalServerError() {
func (this *HTTPRequest) write500() {
statusCode := http.StatusInternalServerError
if this.doPage(statusCode) {
return