# LogDoctor: BWutils Namespace Reference

Loading...
Searching...
No Matches
BWutils Namespace Reference

BWutils. More...

## Functions

std::string | sanitizedMethod (const std::string &item)
| Returns a sanitized item which can be inserted in a list.
std::string | sanitizedUri (const std::string &item)
| Returns a sanitized item which can be inserted in a list.
std::string | sanitizedClient (const std::string &item)
| Returns a sanitized item which can be inserted in a list.
std::string | sanitizedUserAgent (std::string_view item)
| Returns a sanitized item which can be inserted in a list.

## Detailed Description

BWutils.

Utilities for blacklists and warnlists

See also
  Blasklists, Warnlists

## Function Documentation

## sanitizedClient()

std::string BWutils::sanitizedClient | ( | const std::string & | item | ) |

Returns a sanitized item which can be inserted in a list.

This functions doesn't check it the client is actually a valid IP address, only whether it is composed by the proper set of characters (for an IPv4 or an IPv6)

Exceptions

  BWlistException |

## sanitizedMethod()

std::string BWutils::sanitizedMethod | ( | const std::string & | item | ) |

Returns a sanitized item which can be inserted in a list.

This fuction doesn't check if the method is actually a valid HTTP method, only whether the given string is sintattically acceptable.

Exceptions

  BWlistException |

## sanitizedUri()

std::string BWutils::sanitizedUri | ( | const std::string & | item | ) |

Returns a sanitized item which can be inserted in a list.

This function percent-encodes some of the characters in the provided string: /#&?=+

Exceptions

  BWlistException |

## sanitizedUserAgent()

std::string BWutils::sanitizedUserAgent | ( | std::string_view | item | ) |

Returns a sanitized item which can be inserted in a list.

This function back-slashes every double-quotes in the provided string

Exceptions

  BWlistException |