Temp fix/hack for HTTP to work.
This commit is contained in:
parent
4d24f7a02b
commit
beb136ea61
|
@ -283,7 +283,9 @@ defmodule Farmbot.HTTP do
|
|||
|> add_header({"Content-Type", "application/json"})
|
||||
|
||||
opts = opts |> Keyword.put(:timeout, :infinity)
|
||||
url = Farmbot.Jwt.decode!(tkn).iss <> url
|
||||
#TODO Fix this.
|
||||
url = "https:" <> Farmbot.Jwt.decode!(tkn).iss <> url
|
||||
IO.inspect(url)
|
||||
do_normal_request({method, url, body, headers, opts, from}, nil, state)
|
||||
end
|
||||
|
||||
|
|
|
@ -4,12 +4,14 @@ defmodule Farmbot.HTTP.Supervisor do
|
|||
use Supervisor
|
||||
|
||||
@doc "Start HTTP services."
|
||||
def start_link(args, opts \\ []) do
|
||||
Supervisor.start_link(__MODULE__, args, opts)
|
||||
def start_link(token, opts \\ []) do
|
||||
Supervisor.start_link(__MODULE__, token, opts)
|
||||
end
|
||||
|
||||
def init(_args) do
|
||||
children = []
|
||||
def init(token) do
|
||||
children = [
|
||||
worker(Farmbot.HTTP, [token, [name: Farmbot.HTTP]])
|
||||
]
|
||||
opts = [strategy: :one_for_all]
|
||||
supervise(children, opts)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue