Skip to content

Commit

Permalink
Keep protocol in smithy->http4s uri conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Oct 3, 2023
1 parent 7b21e56 commit 34dc62f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,16 @@ package object kernel {

def fromSmithy4sHttpUri(uri: Smithy4sHttpUri): Uri = {
val path = Uri.Path.Root.addSegments(uri.path.map(Uri.Path.Segment(_)).toVector)

Uri(
path = path,
authority = Some(Uri.Authority(host = Uri.RegName(uri.host), port = uri.port))
authority = Some(Uri.Authority(host = Uri.RegName(uri.host), port = uri.port)),
scheme = Some {
uri.scheme match {
case Smithy4sHttpUriScheme.Http => Uri.Scheme.http
case Smithy4sHttpUriScheme.Https => Uri.Scheme.https
}
}
).withMultiValueQueryParams(uri.queryParams)
}

Expand Down

0 comments on commit 34dc62f

Please sign in to comment.