fix: session not init in concatURL

This commit is contained in:
lilong.129
2025-02-19 21:25:52 +08:00
parent 8296433a21
commit ce7417c239
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
v5.0.0+2502192122 v5.0.0+2502192125
+4 -4
View File
@@ -39,14 +39,14 @@ type DriverRequests struct {
} }
const ( const (
rawSessionID = "<NoSession>" emptySessionID = "<SessionNotInit>"
) )
func NewDriverSession() *DriverSession { func NewDriverSession() *DriverSession {
timeout := 30 * time.Second timeout := 30 * time.Second
session := &DriverSession{ session := &DriverSession{
ctx: context.Background(), ctx: context.Background(),
ID: rawSessionID, ID: emptySessionID,
timeout: timeout, timeout: timeout,
client: &http.Client{ client: &http.Client{
Timeout: timeout, Timeout: timeout,
@@ -101,8 +101,8 @@ func (s *DriverSession) concatURL(urlStr string) (string, error) {
} }
// replace with session ID // replace with session ID
if s.ID != rawSessionID { if s.ID != emptySessionID {
urlStr = strings.Replace(urlStr, rawSessionID, s.ID, 1) urlStr = strings.Replace(urlStr, emptySessionID, s.ID, 1)
} }
// 处理完整 URL // 处理完整 URL