Skip to content

Commit dfd7598

Browse files
committed
refractor uri json
Signed-off-by: Adam Ratzman <adam@adamratzman.com>
1 parent ffa5d57 commit dfd7598

File tree

4 files changed

+176
-130
lines changed

4 files changed

+176
-130
lines changed

src/main/kotlin/com/adamratzman/spotify/utils/Endpoints.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ abstract class SpotifyEndpoint(val api: SpotifyAPI) {
8888
}
8989
}
9090

91-
if (document.responseCode / 200 != 1 /* Check if status is 2xx */) {
91+
if (document.responseCode / 200 != 1 /* Check if status is 2xx or 3xx */) {
9292
val message = try {
9393
document.body.toObject<ErrorResponse>(api).error
9494
} catch (e: Exception) {

src/main/kotlin/com/adamratzman/spotify/utils/HttpConnection.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class HttpConnection(
2828
connection.setFixedLengthStreamingMode(body?.toByteArray()?.size ?: 0)
2929
connection.outputStream.bufferedWriter().use {
3030
body?.also(it::write)
31+
it.close()
3132
}
3233
}
3334

0 commit comments

Comments
 (0)