Skip to content

Commit efd5e32

Browse files
committed
修复: namespace 含大写字母时无法访问
1 parent a1b84f6 commit efd5e32

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [2.1.7] - 2023-01-17
4+
5+
- 修复 namespace 含大写字母时无法访问的问题. 原因是因为域名会自动转小写导致无法找到对应的 host, 所以将 id 统一小写化
6+
37
## [2.1.6] - 2023-01-17
48

59
- 将 hid 添加到命令参数中, 方便与其他编辑器集成(指[vscode lcode hub](https://github.com/vscode-lcode/hub))

hub/id.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"regexp"
66
"strconv"
7+
"strings"
78

89
"github.com/jellydator/ttlcache/v3"
910
"github.com/lainio/err2"
@@ -17,7 +18,8 @@ var _ bash.IDGenerator = (*Hub)(nil).IDGenerator
1718

1819
func (hub *Hub) IDGenerator(c bash.LcodeClient) (id bash.ID, err error) {
1920
defer err2.Handle(&err)
20-
host := parseIDRaw(c.RawID())
21+
rawID := strings.ToLower(c.RawID())
22+
host := parseIDRaw(rawID)
2123
if host.No == 0 {
2224
To(hub.addHost(&host))
2325
}

0 commit comments

Comments
 (0)