Skip to content

Commit

Permalink
Support userinfo in teams url (#2877)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach authored Nov 27, 2024
1 parent 20912b8 commit 37d8adb
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions lib/livebook/teams/requests.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 37d8adb

Please sign in to comment.