Skip to content

Commit

Permalink
Split Link header values into different items
Browse files Browse the repository at this point in the history
  • Loading branch information
JorgeMucientes committed Sep 27, 2024
1 parent 9a51a9d commit 6b80a18
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class WPAPIHeadRequest(
override fun parseNetworkResponse(response: NetworkResponse): Response<List<Header>?>? {
val headers = response.allHeaders
?.filter { it.name.equals(LINK_HEADER_NAME, ignoreCase = true) }
?.flatMap {
it.value.split(",")
.map { value -> Header(LINK_HEADER_NAME, value.trimStart()) }
}
?.ifEmpty { null }

return if (headers != null) {
Expand Down

0 comments on commit 6b80a18

Please sign in to comment.