文件路径和代理转发支持中文等UTF-8字符

This commit is contained in:
GoEdgeLab
2020-12-24 19:46:21 +08:00
parent 3c6ad87cb9
commit 4de1451a42
2 changed files with 10 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
package teaconst
const (
Version = "0.0.6"
Version = "0.0.6.1"
ProductName = "Edge Node"
ProcessName = "edge-node"

View File

@@ -74,7 +74,15 @@ type HTTPRequest struct {
func (this *HTTPRequest) init() {
this.writer = NewHTTPWriter(this, this.RawWriter)
this.web = &serverconfigs.HTTPWebConfig{IsOn: true}
this.uri = this.RawReq.URL.RequestURI()
//this.uri = this.RawReq.URL.RequestURI()
// 之所以不使用RequestURI()是不想让URL中的Path被Encode
if len(this.RawReq.URL.RawQuery) > 0 {
this.uri = this.RawReq.URL.Path + "?" + this.RawReq.URL.RawQuery
} else {
this.uri = this.RawReq.URL.Path
}
this.uri = this.RawReq.URL.Path
this.rawURI = this.uri
this.varMapping = map[string]string{
// 缓存相关初始化