MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / getBaseURL

Method getBaseURL

plugins/plugin_utils/plugin_HTTP.cpp:52–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52std::string BZFSHTTP::getBaseURL(void) {
53 std::string URL = "http://";
54 std::string host = "localhost";
55 if (bz_getPublicAddr().size()) {
56 host = bz_getPublicAddr().c_str();
57 }
58
59 // make sure it has the port
60 if (strrchr(host.c_str(), ':') == NULL) {
61 host += format(":%d", bz_getPublicPort());
62 }
63
64 URL += host + "/";
65 URL += getVDir();
66 URL += "/";
67
68 return URL;
69}
70
71bool BZFSHTTP::handleRequest(const HTTPRequest& request, HTTPReply& reply) {
72 if (serviceMimeResources && resourceRootPath.size() && mimeTypes.size()) {

Callers

nothing calls this directly

Calls 5

bz_getPublicPortFunction · 0.85
getVDirFunction · 0.85
c_strMethod · 0.80
formatFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected