diff options
Diffstat (limited to 'plugin/protocol/http/src/http_half.cpp')
| -rw-r--r-- | plugin/protocol/http/src/http_half.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugin/protocol/http/src/http_half.cpp b/plugin/protocol/http/src/http_half.cpp index 07bfa1a..3d832b4 100644 --- a/plugin/protocol/http/src/http_half.cpp +++ b/plugin/protocol/http/src/http_half.cpp @@ -152,8 +152,13 @@ void __hf_public_req_fill_from_private(struct http_half_private * hf_private, st hf_private->method_or_status = (enum tfe_http_std_method) parser->method; const static struct http_field_name __host_field_name = {TFE_HTTP_HOST, NULL}; - hf_private->host = strdup((char *) tfe_http_field_read(hf_public, &__host_field_name)); - hf_req_spec->host = hf_private->host; + + char *host= (char *)tfe_http_field_read(hf_public, &__host_field_name); + if(host) + { + hf_private->host = strdup(host); + hf_req_spec->host = hf_private->host; + } /* uri is stored in underlay evbuffer, we need to append a terminal zero */ static const char __zero = 0; |
