Skip to content

404 page considered as service up #8

@p0n1

Description

@p0n1

I got a service down as the url can be dialed correctly but http status code as 404 and got a 404 page not found from traefik.

The current code seems to take this as service up. Should we also check HTTP status code?

func State(host models.Host) bool {
if host.Port == "" {
host.Port = "80"
}
timeout := 3 * time.Second
target := host.Addr + ":" + host.Port
conn, err := net.DialTimeout("tcp", target, timeout)
if err != nil {
return false
}
conn.Close()
return true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions