mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Fix Queries Containing % (#766)
This commit is contained in:
@@ -20,9 +20,17 @@ class JavalinGraphQLRequestParser : GraphQLRequestParser<Context> {
|
|||||||
@Suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE", "UNCHECKED_CAST")
|
@Suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE", "UNCHECKED_CAST")
|
||||||
override suspend fun parseRequest(context: Context): GraphQLServerRequest? {
|
override suspend fun parseRequest(context: Context): GraphQLServerRequest? {
|
||||||
return try {
|
return try {
|
||||||
|
val contentType = context.contentType()
|
||||||
val formParam =
|
val formParam =
|
||||||
|
if (
|
||||||
|
contentType?.contains("application/x-www-form-urlencoded") == true ||
|
||||||
|
contentType?.contains("multipart/form-data") == true
|
||||||
|
) {
|
||||||
context.formParam("operations")
|
context.formParam("operations")
|
||||||
?: return context.bodyAsClass(GraphQLServerRequest::class.java)
|
?: throw IllegalArgumentException("Cannot find 'operations' body")
|
||||||
|
} else {
|
||||||
|
return context.bodyAsClass(GraphQLServerRequest::class.java)
|
||||||
|
}
|
||||||
|
|
||||||
val request =
|
val request =
|
||||||
context.jsonMapper().fromJsonString(
|
context.jsonMapper().fromJsonString(
|
||||||
|
|||||||
Reference in New Issue
Block a user