MCPcopy Create free account
hub / github.com/apache/brpc / UseHTML

Function UseHTML

src/brpc/builtin/common.cpp:36–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 "For storing profiling results.");
35
36bool UseHTML(const HttpHeader& header) {
37 const std::string* console = header.uri().GetQuery(CONSOLE_STR);
38 if (console != NULL) {
39 return atoi(console->c_str()) == 0;
40 }
41 // [curl header]
42 // User-Agent: curl/7.12.1 (x86_64-redhat-linux-gnu) libcurl/7.12.1 ...
43 const std::string* agent = header.GetHeader(USER_AGENT_STR);
44 if (agent == NULL) { // use text when user-agent is absent
45 return false;
46 }
47 return agent->find("curl/") == std::string::npos;
48}
49
50// Written by Jack Handy
51// <A href="mailto:jakkhandy@hotmail.com">jakkhandy@hotmail.com</A>

Callers 15

default_methodMethod · 0.85
default_methodMethod · 0.85
default_methodMethod · 0.85
default_methodMethod · 0.85
enableMethod · 0.85
disableMethod · 0.85
default_methodMethod · 0.85
DisplayResultFunction · 0.85
DoProfilingFunction · 0.85
StartProfilingFunction · 0.85
default_methodMethod · 0.85
default_methodMethod · 0.85

Calls 4

GetQueryMethod · 0.80
GetHeaderMethod · 0.80
c_strMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected