Skip to content

Commit

Permalink
Merge pull request paultag#6 from divergentdave/regexp-quotemeta
Browse files Browse the repository at this point in the history
Use regexp.QuoteMeta instead of \Q and \E
  • Loading branch information
paultag authored Jul 11, 2016
2 parents e6febc7 + 56c7379 commit c36b858
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 c36b858

Please sign in to comment.