-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Daniel,
On 10/3/18 19:16, Daniel Becroft wrote: > Hi, > > We are setting up Tomcat 8 to use a CGI program (.exe, proprietary) > to generate and return various JSON responses. This all works fine > when the response is a HTTP 200. But, when an HTTP error is > returned (HTTP 4xx), Tomcat is generating the HTML page instead. > > We have the same setup working under IIS, and we had to configure > the following option there to stop IIS doing the same thing: > > <httpErrors existingResponse="Passthrough"> > > Is there an existing option somewhere in Tomcat that will do the > same thing (ie keep the CGI response intact even if it's a HTTP > error)? I can't seem to find one. See Mark's response for the "answer" to this; I had another question. HTTP 4xx responses are usually telling the client that their request was bad for some reason, and generally the response entity (the page returned) is not relevant. What kinds of responses are you returning for these errors? Or are you trying to make sure that the response is still JSON even if an error occurs? - -chris -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlu2SgEACgkQHPApP6U8 pFg9NA/+I2oFYemUtGs2MYJ+UKeB80SPtxdZyxdYdAVOqIa+hdq4cimxq648NGB0 eWalhK7PAn5d24XeUTCSoeKiBcn/CRvGW1E+2qv9tdXZRU7ZQneDWu4vDpm/VK1s Jlv54CdhOr+0BaBY8Gsj/wGncMBpmG0XFNZxJXcGFb63Z9GMsaUxS18dfzC+Lbdc k3Pg2/8s9+dMOwlGYjOZ+uK02Kk2XllCdZhn+rljoImqj1st23fwgdoI4FWho5Pa H9KtWhteYNI6V7F59+5pbl8AyzkWvEyD/AsM2UwXMQBUTyuB0sNj+P5lXGZkDZn5 4eMfpUCbK2m9upquulOYGhtuYwfCqoc9zMIY7eu8mfHKfevmRL9+QBT8iz4QogHw 3F1nMm3wM3uZNInFoRTjfsHTcUdtSKRCAA4G5ocyGSezI4FWU/aWVMz27ZkoUV1e 205YN8+sjk25ihkNDsTZkqXiG3V7IC3Yqh3fiuZQGyL9Zv8GH0dKK9Nu4WTJgjZI saHb+Wsghb3+B9dNMiI4MSrvTnmTUWDT70IX47ArpNH4C23aID9gpIjS72OniAuW Il/a3McqyxR+T2sgaOLN+gY1FbW+XAGPhVQ8TZeywfBB//mdbPGqd24kg3ctEvPm FWGYapZPIcF7i7RE0JaIZH0QH1wmrBqIPiSeKLxEtUA6RJV3Hg8= =OCPo -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org