Skip to content

Commit

Permalink
修复: namespace 含大写字母时无法访问
Browse files Browse the repository at this point in the history
  • Loading branch information
shynome committed Jan 16, 2023
1 parent a1b84f6 commit efd5e32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [2.1.7] - 2023-01-17

- 修复 namespace 含大写字母时无法访问的问题. 原因是因为域名会自动转小写导致无法找到对应的 host, 所以将 id 统一小写化

## [2.1.6] - 2023-01-17

- 将 hid 添加到命令参数中, 方便与其他编辑器集成(指[vscode lcode hub](https://github.com/vscode-lcode/hub))
Expand Down
4 changes: 3 additions & 1 deletion hub/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"regexp"
"strconv"
"strings"

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

func (hub *Hub) IDGenerator(c bash.LcodeClient) (id bash.ID, err error) {
defer err2.Handle(&err)
host := parseIDRaw(c.RawID())
rawID := strings.ToLower(c.RawID())
host := parseIDRaw(rawID)
if host.No == 0 {
To(hub.addHost(&host))
}
Expand Down

0 comments on commit efd5e32

Please sign in to comment.