Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Obfuscate ¶
Obfuscate hashes the input string to prevent logging sensitive information. HighwayHash is a hashing algorithm enabling high speed (especially on AMD64).
func RejectLineBreakInURI ¶
RejectLineBreakInURI rejects HTTP requests having a Carriage Return "\r" or a Line Feed "\n" within the URI to prevent log injection.
func Sanitize ¶
Sanitize replaces control codes by the tofu symbol and invalid UTF-8 codes by the replacement character. Sanitize can be used to prevent log injection. Inspired from: https://wikiless.org/wiki/Replacement_character#Replacement_character https://graphicdesign.stackexchange.com/q/108297
func ValidForLogging ¶
ValidForLogging returns false if input string contains a Carriage Return "\r", or a Line Feed "\n", or any other ASCII control code (except space), or, as well as, invalid UTF-8 codes. ValidForLogging can be used to prevent log injection.
func ValidPath ¶
func ValidPath(w http.ResponseWriter, r *http.Request) bool
ValidPath replies a HTTP error on invalid path to prevent path traversal attacks.
func ValidRuneForLogging ¶
ValidRuneForLogging returns false if rune is a Carriage Return "\r", or a Line Feed "\n", or another ASCII control code (except space), or an invalid UTF-8 code. ValidRuneForLogging can be used to prevent log injection.