MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / redirect

Function redirect

dependencies/httplib/httplib.h:3655–3677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3653
3654template <typename T>
3655inline bool redirect(T &cli, Request &req, Response &res,
3656 const std::string &path, const std::string &location,
3657 Error &error) {
3658 Request new_req = req;
3659 new_req.path = path;
3660 new_req.redirect_count_ -= 1;
3661
3662 if (res.status == 303 && (req.method != "GET" && req.method != "HEAD")) {
3663 new_req.method = "GET";
3664 new_req.body.clear();
3665 new_req.headers.clear();
3666 }
3667
3668 Response new_res;
3669
3670 auto ret = cli.send(new_req, new_res, error);
3671 if (ret) {
3672 req = new_req;
3673 res = new_res;
3674 res.location = location;
3675 }
3676 return ret;
3677}
3678
3679inline std::string params_to_query_str(const Params &params) {
3680 std::string query;

Callers 2

handle_requestMethod · 0.85
redirectMethod · 0.85

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected