File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -137,9 +137,7 @@ func (p *PerHost) AddNetwork(net *net.IPNet) {
137137// AddZone specifies a DNS suffix that will use the bypass proxy. A zone of
138138// "example.com" matches "example.com" and all of its subdomains.
139139func (p * PerHost ) AddZone (zone string ) {
140- if strings .HasSuffix (zone , "." ) {
141- zone = zone [:len (zone )- 1 ]
142- }
140+ zone = strings .TrimSuffix (zone , "." )
143141 if ! strings .HasPrefix (zone , "." ) {
144142 zone = "." + zone
145143 }
@@ -148,8 +146,6 @@ func (p *PerHost) AddZone(zone string) {
148146
149147// AddHost specifies a host name that will use the bypass proxy.
150148func (p * PerHost ) AddHost (host string ) {
151- if strings .HasSuffix (host , "." ) {
152- host = host [:len (host )- 1 ]
153- }
149+ host = strings .TrimSuffix (host , "." )
154150 p .bypassHosts = append (p .bypassHosts , host )
155151}
You can’t perform that action at this time.
0 commit comments