MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / _Redirect

Method _Redirect

cpp/src/platform/HttpClient.cpp:1028–1055  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1026
1027
1028bool HttpSocket::_Redirect
1029(
1030std::string loc,
1031bool forceGET
1032)
1033{
1034 traceprint("Following HTTP redirect to: %s\n", loc.c_str());
1035 if(loc.empty())
1036 return false;
1037
1038 Request req;
1039 req.user = _curRequest.user;
1040 req.useSSL = _curRequest.useSSL;
1041 if(!forceGET)
1042 req.post = _curRequest.post;
1043 SplitURI(loc, req.protocol, req.host, req.resource, req.port, req.useSSL);
1044 if(req.protocol.empty()) // assume local resource
1045 {
1046 req.host = _curRequest.host;
1047 req.resource = loc;
1048 }
1049 if(req.host.empty())
1050 req.host = _curRequest.host;
1051 if(req.port < 0)
1052 req.port = _curRequest.port;
1053 req.extraGetHeaders = _curRequest.extraGetHeaders;
1054 return SendRequest(req, false);
1055}
1056
1057bool HttpSocket::SendRequest
1058(

Callers

nothing calls this directly

Calls 3

SplitURIFunction · 0.85
c_strMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected