Skip to content

Commit

Permalink
Merge pull request #92 from andacata/fix/91_uncontrolled_IndexOutOfBo…
Browse files Browse the repository at this point in the history
…undsException_on_nextPageUrl

fix(transport) #91: Avoid throwing IndexOutOfBoundsException when Link header is missing content
  • Loading branch information
lilgallon authored Mar 22, 2024
2 parents 6aaf27c + 941c746 commit 35bbea8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ inline fun <reified T> HttpResponse.parsePaginatedBody(offset: Int): OcpiRespons
limit = getHeader(Header.X_LIMIT)?.toInt()
?: throw OcpiToolkitMissingRequiredResponseHeaderException(Header.X_LIMIT),
offset = offset,
nextPageUrl = getHeader(Header.LINK)?.split("<")?.get(1)?.split(">")?.first()
nextPageUrl = getHeader(Header.LINK)?.split("<")?.elementAtOrNull(1)?.split(">")?.first()
),
status_code = parsedBody.status_code,
status_message = parsedBody.status_message,
Expand Down

0 comments on commit 35bbea8

Please sign in to comment.