Skip to content

Commit

Permalink
chore: Fix potential slowloris attack (GO-S2112)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikawaha committed Oct 16, 2023
1 parent 08c1152 commit ddcfb29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/server/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os"
"os/signal"
"syscall"
"time"

"github.com/ikawaha/kagome-dict/dict"
"github.com/ikawaha/kagome-dict/ipa"
Expand Down Expand Up @@ -106,8 +107,9 @@ func command(ctx context.Context, opt *option) error {
mux.Handle("/", &TokenizeDemoHandler{tokenizer: t})
mux.Handle("/tokenize", &TokenizeHandler{tokenizer: t})
srv := http.Server{
Addr: opt.http,
Handler: mux,
Addr: opt.http,
Handler: mux,
ReadHeaderTimeout: 20 * time.Second,
}
ch := make(chan error)
go func() {
Expand Down

0 comments on commit ddcfb29

Please sign in to comment.