mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-11-11 22:51:43 +08:00
Support userinfo in teams url (#2877)
This commit is contained in:
parent
20912b87eb
commit
37d8adb2dd
1 changed files with 15 additions and 4 deletions
|
|
@ -291,10 +291,21 @@ defmodule Livebook.Teams.Requests do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp build_req() do
|
defp build_req() do
|
||||||
Req.new(
|
base_url = URI.new!(Livebook.Config.teams_url())
|
||||||
base_url: Livebook.Config.teams_url(),
|
|
||||||
headers: [{"x-lb-version", Livebook.Config.app_version()}]
|
options =
|
||||||
)
|
if userinfo = base_url.userinfo do
|
||||||
|
[
|
||||||
|
base_url: %{base_url | userinfo: nil},
|
||||||
|
auth: {:basic, userinfo}
|
||||||
|
]
|
||||||
|
else
|
||||||
|
[
|
||||||
|
base_url: base_url
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
Req.new([headers: [{"x-lb-version", Livebook.Config.app_version()}]] ++ options)
|
||||||
|> Livebook.Utils.req_attach_defaults()
|
|> Livebook.Utils.req_attach_defaults()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue