Skip to content

Commit

Permalink
Merge pull request #2 from StreamAMG/feature/SE-810-playback-sdk-inte…
Browse files Browse the repository at this point in the history
…gration

[SE-810] Add token only when it's not blank
  • Loading branch information
artem-y-pamediagroup authored Mar 29, 2024
2 parents 7050fed + 730cbb8 commit c3b9265
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ internal class PlayBackAPIService(private val apiKey: String) : PlayBackAPI {
try {
setRequestProperty("Accept", "application/json")
setRequestProperty("x-api-key", apiKey)
authorizationToken?.let { setRequestProperty("Authorization", "Bearer $it") }
if (!authorizationToken.isNullOrBlank()) {
setRequestProperty("Authorization", "Bearer $authorizationToken")
}

val responseText = if (responseCode == HttpURLConnection.HTTP_OK) {
inputStream.bufferedReader().use(BufferedReader::readText)
Expand Down

0 comments on commit c3b9265

Please sign in to comment.