Robin Larsen
07/22/2019, 6:20 PMnet::ERR_INVALID_CHUNKED_ENCODING 200 (200)
both in Chrome and Firefox. All other endpoints not using the templates work fine (JSON, plain text)
I have other apps running just fine on the same server using Thymeleaf, although the apps are made with SpringBoot.
Any ideas?cy
07/24/2019, 11:50 AMcy
07/24/2019, 11:50 AMcy
07/24/2019, 11:51 AMRobin Larsen
07/24/2019, 5:51 PMTransfer-Encoding -> chunked
is set twice, as well as no Content-Length
.
So that's where I stand right now. I think Apache is confused about especially the double Transfer-Encoding
headers, mainly because functional webapps written in Spring only set it once (deployed in Tomcat). Maybe Ktor and Tomcat are both setting it for some weird reason.
But alas, I'm no web wizard, so I'm mostly doing trial and error 🤷Robin Larsen
07/24/2019, 6:30 PMcatalina.out
), I see Thymeleaf locates the correct template file and renders it. In mod_jk.log
I see how the request from Apache gets forwarded to an AJP worker and a response generated and sent back.
I can see, however, where the SpringBoot app and Ktor apps differ in terms of headers. In the mod_jk
log, the SpringBoot app only sets 2 headers in the response:
[Wed Jul 24 20:27:34.375 2019] [44088:139791852492672] [debug] ajp_unmarshal_response::jk_ajp_common.c (739): (ajp13_worker) status = 200
[Wed Jul 24 20:27:34.375 2019] [44088:139791852492672] [debug] ajp_unmarshal_response::jk_ajp_common.c (746): Number of headers is = 2
[Wed Jul 24 20:27:34.375 2019] [44088:139791852492672] [debug] ajp_unmarshal_response::jk_ajp_common.c (802): (ajp13_worker) Header[0] [Content-Type] = [text/html;charset=UTF-8]
[Wed Jul 24 20:27:34.375 2019] [44088:139791852492672] [debug] ajp_unmarshal_response::jk_ajp_common.c (802): (ajp13_worker) Header[1] [Content-Language] = [en-US]
In contrast, Ktor has set 5 headers at this point:
[Wed Jul 24 20:29:26.408 2019] [44632:139791852492672] [debug] ajp_unmarshal_response::jk_ajp_common.c (802): (ajp13_worker) Header[0] [Date] = [Wed, 24 Jul 2019 18:29:26 GMT]
[Wed Jul 24 20:29:26.408 2019] [44632:139791852492672] [debug] ajp_unmarshal_response::jk_ajp_common.c (802): (ajp13_worker) Header[1] [Server] = [ktor-server-core/1.2.2 ktor-server-core/1.2.2]
[Wed Jul 24 20:29:26.408 2019] [44632:139791852492672] [debug] ajp_unmarshal_response::jk_ajp_common.c (802): (ajp13_worker) Header[2] [Transfer-Encoding] = [chunked]
[Wed Jul 24 20:29:26.408 2019] [44632:139791852492672] [debug] ajp_unmarshal_response::jk_ajp_common.c (802): (ajp13_worker) Header[3] [Connection] = [keep-alive]
[Wed Jul 24 20:29:26.408 2019] [44632:139791852492672] [debug] ajp_unmarshal_response::jk_ajp_common.c (802): (ajp13_worker) Header[4] [Content-Type] = [text/html;charset=UTF-8]
Don't know what to make of it.