Browse Source

make the host/domain matching case-insensitive (#3966)

pull/3967/head
fatedier 10 months ago committed by GitHub
parent
commit
1c8bc0bfa8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      Release.md
  2. 6
      pkg/util/vhost/router.go

4
Release.md

@ -5,3 +5,7 @@
### Features
* The `Refresh` and `ClearOfflineProxies` buttons have been added to the Dashboard of frps.
### Fixes
* The host/domain matching in the routing rules has been changed to be case-insensitive.

6
pkg/util/vhost/router.go

@ -33,6 +33,8 @@ func NewRouters() *Routers {
}
func (r *Routers) Add(domain, location, httpUser string, payload interface{}) error {
domain = strings.ToLower(domain)
r.mutex.Lock()
defer r.mutex.Unlock()
@ -64,6 +66,8 @@ func (r *Routers) Add(domain, location, httpUser string, payload interface{}) er
}
func (r *Routers) Del(domain, location, httpUser string) {
domain = strings.ToLower(domain)
r.mutex.Lock()
defer r.mutex.Unlock()
@ -86,6 +90,8 @@ func (r *Routers) Del(domain, location, httpUser string) {
}
func (r *Routers) Get(host, path, httpUser string) (vr *Router, exist bool) {
host = strings.ToLower(host)
r.mutex.RLock()
defer r.mutex.RUnlock()

Loading…
Cancel
Save