Skip to content

Commit

Permalink
Use regexp.QuoteMeta instead of \Q and \E
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave committed Jul 11, 2016
1 parent e6febc7 commit 56c7379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (c *Config) CreateProxy() (Proxy, error) {
if server.Regexp {
host_regexp, err = regexp.Compile(hostname)
} else {
host_regexp, err = regexp.Compile("^\\Q" + hostname + "\\E$")
host_regexp, err = regexp.Compile("^" + regexp.QuoteMeta(hostname) + "$")
}
if err != nil {
return Proxy{}, err
Expand Down

0 comments on commit 56c7379

Please sign in to comment.