Skip to content

Commit

Permalink
Support userinfo in teams url
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed Nov 27, 2024
1 parent 7c8f464 commit b935bb6
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 b935bb6

Please sign in to comment.