Stability | experimental |
---|---|
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
Helper utilities used within the library and the server which also could be useful for other application code.
Synopsis
- santinizePath :: FilePath -> FilePath
- santinizeIfNotUrl :: FilePath -> FilePath
- asciiOrd :: Char -> Word8
- asciiChr :: Word8 -> Char
- uEncode :: String -> ByteString
- uDecode :: ByteString -> String
- stripNewline :: ByteString -> ByteString
Security
santinizePath :: FilePath -> FilePath Source #
Normalise a path and prevent directory traversal attacks.
santinizeIfNotUrl :: FilePath -> FilePath Source #
String Encoding
uEncode :: String -> ByteString Source #
Encode a String
to a UTF-8 ByteString
uDecode :: ByteString -> String Source #
Decode a UTF-8 ByteString
to a String
Misc Helpers
stripNewline :: ByteString -> ByteString Source #
Strip \r
and \n
from ByteString
s