Skip to content

client needs Host header #7

Closed
Closed
@squashmode

Description

@squashmode

The client, when doing a request to a server, does not include the host in the header. This causes some failures on some sites. Something like this fixes the problem (presumably also needed for HEAD and POST methods):

@@ -1078,6 +1084,7 @@ inline std::shared_ptr<Response> Client::get(const char* path)
     Request req;
     req.method = "GET";
     req.path = path;
+    req.set_header("Host", host_.c_str());
 
     auto res = std::make_shared<Response>();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions