Skip to content

Commit

Permalink
fix: media not found message
Browse files Browse the repository at this point in the history
  • Loading branch information
RobozinhoD authored and BrayanDSO committed Feb 4, 2024
1 parent e3520eb commit 1d056ef
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions AnkiDroid/src/main/java/com/ichi2/anki/pages/AnkiServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,18 @@ open class AnkiServer(
override fun useGzipWhenAccepted(r: Response?) = false

override fun serve(session: IHTTPSession): Response {
if (session.method == Method.POST) {
val uri = session.uri
Timber.d("POST: Requested %s", uri)
val inputBytes = getSessionBytes(session)
return buildResponse {
postHandler.handlePostRequest(uri, inputBytes)
return when (session.method) {
Method.POST -> {
val uri = session.uri
Timber.d("POST: Requested %s", uri)
val inputBytes = getSessionBytes(session)
buildResponse {
postHandler.handlePostRequest(uri, inputBytes)
}
}
Method.GET -> newFixedLengthResponse(Response.Status.NOT_FOUND, null, null)
else -> newFixedLengthResponse(null)
}
return newFixedLengthResponse(null)
}

private fun buildResponse(
Expand Down

0 comments on commit 1d056ef

Please sign in to comment.