From 8da9001d8f38f082fe811c7f609a435cffaaa4d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Sun, 1 May 2022 08:58:35 +0800 Subject: [PATCH] update url parse --- http.go | 2 +- url.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/http.go b/http.go index 1e89e5c..6f975ef 100644 --- a/http.go +++ b/http.go @@ -14,7 +14,7 @@ import ( "time" ) -const Version = "1.0.8" +const Version = "1.0.9" // Response 返回内容 type Response struct { diff --git a/url.go b/url.go index 904f880..45e7ecd 100644 --- a/url.go +++ b/url.go @@ -6,8 +6,10 @@ import ( type ResponseUrlParse struct { Scheme string `json:"scheme"` // 协议 + Host string `json:"host"` // 主机 Hostname string `json:"hostname"` // 主机名 Port string `json:"port"` // 端口 + HostPath string `json:"host_path"` // 主机加路径 Path string `json:"path"` // 路径 RawQuery string `json:"raw_query"` // 参数 ? Fragment string `json:"fragment"` // 片段 # @@ -20,8 +22,10 @@ func UrlParse(inputUrl string) (resp ResponseUrlParse) { return } resp.Scheme = parse.Scheme + resp.Host = parse.Host resp.Hostname = parse.Hostname() resp.Port = parse.Port() + resp.HostPath = parse.Host + parse.Path resp.Path = parse.Path resp.RawQuery = parse.RawQuery resp.Fragment = parse.Fragment