diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2022-06-04 16:20:04 +0100 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2022-06-04 16:20:04 +0100 |
| commit | d90994408fed47a8fb7a2d82e2f751d8da7067e4 (patch) | |
| tree | 5ad0d4570f81877873f5b7dc98a3f2791130b1ed /main.go | |
| parent | de889e3a7e198c6a47fa6c47a4e2526259f0ee98 (diff) | |
Generate destinations with a regular expression
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -13,6 +13,7 @@ import ( "net/http" "os" "os/signal" + "regexp" "time" "golang.org/x/sys/unix" @@ -33,7 +34,7 @@ func main() { done := make(chan os.Signal, 1) signal.Notify(done, os.Interrupt, unix.SIGTERM) - srv := http.Server{Handler: &redirector{*from, *to, *vcs}} + srv := http.Server{Handler: &redirector{regexp.MustCompile(*from), *to, *vcs}} go func() { ln, err := listenSD() if err != nil { |
