Skip to content

Add timeout to http server #288

Description

@jholdstock

HTTP server is initialized without a timeout. This is highlighted by the linter as a security issue.

G114: Use of net/http serve function that has no support for setting timeouts (gosec)

dcrvotingweb/main.go

Lines 449 to 453 in 39589dc

err = http.ListenAndServe(cfg.Listen, nil)
if err != nil {
log.Printf("Failed to bind http server: %v", err)
cancel()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions