File tree 1 file changed +2
-6
lines changed
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) {
137
137
// AddZone specifies a DNS suffix that will use the bypass proxy. A zone of
138
138
// "example.com" matches "example.com" and all of its subdomains.
139
139
func (p * PerHost ) AddZone (zone string ) {
140
- if strings .HasSuffix (zone , "." ) {
141
- zone = zone [:len (zone )- 1 ]
142
- }
140
+ zone = strings .TrimSuffix (zone , "." )
143
141
if ! strings .HasPrefix (zone , "." ) {
144
142
zone = "." + zone
145
143
}
@@ -148,8 +146,6 @@ func (p *PerHost) AddZone(zone string) {
148
146
149
147
// AddHost specifies a host name that will use the bypass proxy.
150
148
func (p * PerHost ) AddHost (host string ) {
151
- if strings .HasSuffix (host , "." ) {
152
- host = host [:len (host )- 1 ]
153
- }
149
+ host = strings .TrimSuffix (host , "." )
154
150
p .bypassHosts = append (p .bypassHosts , host )
155
151
}
You can’t perform that action at this time.
0 commit comments