Skip to content

Commit

Permalink
fix(android): fix invalid encoding of scopes in query parameters
Browse files Browse the repository at this point in the history
Before this, the `it.value.toString()` caused the list of scopes to be
encoded like `scopes[]=[scope1, scope2]` which is invalid.

This change fixes the encoding to `scopes[]=scope1&scopes[]=scope2` as
expected by the server.
  • Loading branch information
stnguyen90 committed Sep 16, 2024
1 parent 9754b19 commit bde2343
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {
return@forEach
}
is List<*> -> {
apiQuery.add("${it.key}[]=${it.value.toString()}")
(it.value as List<*>).forEach { v ->
apiQuery.add("${it.key}[]=${v.toString()}")
}
}
else -> {
apiQuery.add("${it.key}=${it.value.toString()}")
Expand Down

0 comments on commit bde2343

Please sign in to comment.