MCPcopy Create free account
hub / github.com/apache/trafficserver / setHost

Method setHost

src/tscpp/api/Request.cc:172–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172void
173Request::setHost(std::string const &host)
174{
175 static const std::string HOST_FIELD_NAME(TS_MIME_FIELD_HOST, TS_MIME_LEN_HOST);
176
177 if (state_->hdr_buf_ && state_->hdr_loc_) {
178 Url &url = this->getUrl();
179
180 // Update the URL if it has a host currently.
181 if (!url.getHost().empty()) {
182 url.setHost(host);
183 }
184
185 // Force a HOST field.
186 this->getHeaders().set(HOST_FIELD_NAME, host);
187 }
188}
189
190Request::~Request()
191{

Callers

nothing calls this directly

Calls 4

getUrlMethod · 0.45
emptyMethod · 0.45
getHostMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected