Fix setting the host header

parent 7920fa70
...@@ -822,6 +822,7 @@ zfr_include(struct req *preq, struct zipflow_request *zfr) ...@@ -822,6 +822,7 @@ zfr_include(struct req *preq, struct zipflow_request *zfr)
struct vmod_priv *task_priv; struct vmod_priv *task_priv;
struct vrt_ctx ctx[1]; struct vrt_ctx ctx[1];
enum req_fsm_nxt s; enum req_fsm_nxt s;
const char *h;
CHECK_OBJ_NOTNULL(preq, REQ_MAGIC); CHECK_OBJ_NOTNULL(preq, REQ_MAGIC);
CHECK_OBJ_NOTNULL(preq->top, REQTOP_MAGIC); CHECK_OBJ_NOTNULL(preq->top, REQTOP_MAGIC);
...@@ -862,7 +863,8 @@ zfr_include(struct req *preq, struct zipflow_request *zfr) ...@@ -862,7 +863,8 @@ zfr_include(struct req *preq, struct zipflow_request *zfr)
http_SetH(req->http, HTTP_HDR_URL, zfr->uri); http_SetH(req->http, HTTP_HDR_URL, zfr->uri);
if (zfr->host != NULL && *zfr->host != '\0') { if (zfr->host != NULL && *zfr->host != '\0') {
http_Unset(req->http, H_Host); http_Unset(req->http, H_Host);
http_SetHeader(req->http, zfr->host); h = WS_Printf(req->ws, "Host: %s", zfr->host);
http_SetHeader(req->http, h);
} }
http_ForceField(req->http, HTTP_HDR_METHOD, "GET"); http_ForceField(req->http, HTTP_HDR_METHOD, "GET");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment