Skip to content

Commit

Permalink
fix: resolve HTTP header(content-type) verification error in Legado
Browse files Browse the repository at this point in the history
The commit updates the content type of the audio response in `SystemTtsForwardServer` to `audio/x-wav` and sets the HTTP status to `HttpStatusCode.OK`.
  • Loading branch information
jing332 committed Feb 20, 2025
1 parent 4fc4560 commit b19b20c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.github.jing332.server.BaseCallback
import com.github.jing332.server.Server
import com.github.jing332.server.installPlugins
import io.ktor.http.ContentType
import io.ktor.http.HttpStatusCode
import io.ktor.http.decodeURLQueryComponent
import io.ktor.server.application.ApplicationCallPipeline
import io.ktor.server.application.call
Expand Down Expand Up @@ -45,7 +46,7 @@ class SystemTtsForwardServer(val port: Int, val callback: Callback) : Server {
suspend fun RoutingContext.handleTts(
params: TtsParams,
) {
call.respondOutputStream(ContentType.parse("audio/wav")) {
call.respondOutputStream(ContentType.parse("audio/x-wav"), status = HttpStatusCode.OK) {
callback.tts(output = this, params)
}
}
Expand Down

0 comments on commit b19b20c

Please sign in to comment.