mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-04 20:14:57 +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
|
||||
|
||||
defp build_req() do
|
||||
Req.new(
|
||||
base_url: Livebook.Config.teams_url(),
|
||||
headers: [{"x-lb-version", Livebook.Config.app_version()}]
|
||||
)
|
||||
base_url = URI.new!(Livebook.Config.teams_url())
|
||||
|
||||
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()
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue