MCPcopy Create free account
hub / github.com/3rdparty/libprocess / OK

Method OK

src/http.cpp:690–711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688
689
690OK::OK(const JSON::Value& value, const Option<string>& jsonp)
691 : Response(Status::OK)
692{
693 type = BODY;
694
695 if (jsonp.isSome()) {
696 headers["Content-Type"] = "text/javascript";
697
698 string stringified = stringify(value);
699
700 body.reserve(jsonp->size() + 1 + stringified.size() + 1);
701 body += jsonp.get();
702 body += "(";
703 body += stringified;
704 body += ")";
705 } else {
706 headers["Content-Type"] = "application/json";
707 body = stringify(value);
708 }
709
710 headers["Content-Length"] = stringify(body.size());
711}
712
713
714OK::OK(JSON::Proxy&& value, const Option<string>& jsonp)

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected