Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent fully qualified URLs in check paths #3273

Closed
schmichael opened this issue Sep 25, 2017 · 2 comments
Closed

Prevent fully qualified URLs in check paths #3273

schmichael opened this issue Sep 25, 2017 · 2 comments

Comments

@schmichael
Copy link
Member

Nomad version

Nomad v0.6.3

Issue

HTTP checks can specify absolute URLs to query remote services. This overwrites the port and proto parameters.

The docs specify the intended behavior that only relative URLs are accepted. The current behavior is an unintentional side-effect of the underlying Go stdlib function we call: https://golang.org/pkg/net/url/#URL.ResolveReference

Job file (if appropriate)

job "echo" {
  datacenters = ["dc1"]
    task "caddy" {
      driver = "raw_exec"
      config {
        command = "caddy"
        args    = ["-port", "${NOMAD_PORT_db}"]
      }

      resources {
        cpu    = 200
        memory = 256
        network {
          mbits = 10
          port "db" {}
        }
      }

      service {
        name = "caddy"
        port = "db"
        check {
          type = "http"
          path = "https://google.com"
          timeout = "2s"
          interval = "3s"
        }
      }

    }
}
@dbresson
Copy link

dbresson commented Apr 17, 2018

This wasn't actually fixed by the PR. It relies on IsAbs, which just checks the scheme.

You can still override the ip/port like so:

  service {
    name = "caddy"
    port = "db"
    check {
      type = "http"
      path = "//google.com/"
      timeout = "2s"
      interval = "3s"
    }
  }

@github-actions
Copy link

github-actions bot commented Dec 1, 2022

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants