MCPcopy Create free account
hub / github.com/catboost/catboost / GetPathAndQuery

Function GetPathAndQuery

library/cpp/string_utils/url/url.cpp:295–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295TStringBuf GetPathAndQuery(const TStringBuf url Y_LIFETIME_BOUND, bool trimFragment) noexcept {
296 const size_t off = url.find('/', GetHttpPrefixSize(url));
297 TStringBuf hostUnused, path;
298 if (!url.TrySplitAt(off, hostUnused, path))
299 return "/";
300
301 return trimFragment ? path.Before('#') : path;
302}
303
304// this strange creature returns 2nd level domain, possibly with port
305TStringBuf GetDomain(const TStringBuf host Y_LIFETIME_BOUND) noexcept {

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 4

GetHttpPrefixSizeFunction · 0.85
TrySplitAtMethod · 0.80
BeforeMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected