MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / hasUrlUnsafeBytes

Function hasUrlUnsafeBytes

Libraries/HttpClient/HttpClient.cpp:284–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282 switch (mode)
283 {
284 case SC::HttpClientRequestProxyOptions::Default:
285 case SC::HttpClientRequestProxyOptions::NoProxy:
286 case SC::HttpClientRequestProxyOptions::Http: return true;
287 }
288 return false;
289}
290
291static bool hasHttpHeaderUnsafeBytes(SC::StringSpan value)
292{
293 const SC::Span<const char> bytes = value.toCharSpan();
294 for (size_t idx = 0; idx < bytes.sizeInBytes(); ++idx)
295 {
296 if (bytes[idx] == '\r' or bytes[idx] == '\n' or bytes[idx] == '\0')
297 {
298 return true;
299 }

Callers 2

validateProxyOptionsFunction · 0.85
validateRequestUrlFunction · 0.85

Calls 1

sizeInBytesMethod · 0.45

Tested by

no test coverage detected