mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-06 10:00:25 +08:00
服务增加是否合并URL中的多余分隔符选项
This commit is contained in:
@@ -86,13 +86,21 @@ type HTTPRequest struct {
|
||||
// 初始化
|
||||
func (this *HTTPRequest) init() {
|
||||
this.writer = NewHTTPWriter(this, this.RawWriter)
|
||||
this.web = &serverconfigs.HTTPWebConfig{IsOn: true}
|
||||
this.web = &serverconfigs.HTTPWebConfig{
|
||||
IsOn: true,
|
||||
}
|
||||
|
||||
// this.uri = this.RawReq.URL.RequestURI()
|
||||
// 之所以不使用RequestURI(),是不想让URL中的Path被Encode
|
||||
var urlPath = this.RawReq.URL.Path
|
||||
if this.Server.Web != nil && this.Server.Web.MergeSlashes {
|
||||
urlPath = utils.CleanPath(urlPath)
|
||||
this.web.MergeSlashes = true
|
||||
}
|
||||
if len(this.RawReq.URL.RawQuery) > 0 {
|
||||
this.uri = this.RawReq.URL.Path + "?" + this.RawReq.URL.RawQuery
|
||||
this.uri = urlPath + "?" + this.RawReq.URL.RawQuery
|
||||
} else {
|
||||
this.uri = this.RawReq.URL.Path
|
||||
this.uri = urlPath
|
||||
}
|
||||
|
||||
this.rawURI = this.uri
|
||||
|
||||
Reference in New Issue
Block a user