Skip to content

Commit

Permalink
Merge pull request #338 from tanettrimas/master
Browse files Browse the repository at this point in the history
Make sure the urls are resolved with the correct host
  • Loading branch information
ybelMekk authored Sep 28, 2022
2 parents c753cde + 380a139 commit 2f4c49d
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,17 @@ data class OAuth2HttpRequest(
.encodedPath(originalUrl.encodedPath)
.query(originalUrl.query).build()
} else {
originalUrl
hostheader?.let {
val hostUri = URI(originalUrl.scheme, hostheader, null, null, null).parseServerAuthority()
HttpUrl.Builder()
.scheme(hostUri.scheme)
.host(hostUri.host)
.port(hostUri.port)
.encodedPath(originalUrl.encodedPath)
.query(originalUrl.query)
.build()
} ?: originalUrl

}
}

Expand Down

0 comments on commit 2f4c49d

Please sign in to comment.