/* Not an HTTP response */
msg->vsn = 0;
}
- else {
+ else if (objt_server(s->target)) {
/* HTTP response from a server, use it to set the response version */
char *ptr;
ptr = HTX_SL_RES_VPTR(sl);
msg->vsn = ((ptr[5] - '0') << 4) + (ptr[7] - '0');
+
+ /* If front endpoint is an applet, use the server version for the request */
+ if (sc_ep_test(s->scf, SE_FL_T_APPLET))
+ txn->req.vsn = msg->vsn;
+ }
+ else {
+ /* HTTP response from an applet, use the request version for the response */
+ msg->vsn = txn->req.vsn;
}
/* Adjust server's health based on status code. Note: status codes 501
if (s->txn->meth == HTTP_METH_HEAD)
htx_skip_msg_payload(htx);
+ /* Respnse from haproxy, override HTTP response verison using the request one */
+ s->txn->rsp.vsn = s->txn->req.vsn;
+
channel_auto_read(req);
channel_abort(req);
channel_htx_erase(req, htxbuf(&req->buf));