Documentation
¶
Overview ¶
Package sanitize provides functions which check whether a path expands to be outside the allowed root directory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorIfNotSane ¶
ErrorIfNotSane is like IsSane, except that it returns a PathNotSaneError if the path is outside the root path. It will also return any errors encountered by IsSane. This function is useful if you wish to pass the error along in your own program, as you don't have to come up with a custom error type, message etc.
Types ¶
type PathNotAbsoluteError ¶
type PathNotAbsoluteError struct {
// contains filtered or unexported fields
}
PathNotAbsoluteError is returned if a path isn't absolute.
func (PathNotAbsoluteError) Error ¶
func (p PathNotAbsoluteError) Error() string
Err serializes the PathNotAbsoluteError.
type PathNotSaneError ¶
type PathNotSaneError struct {
// contains filtered or unexported fields
}
PathNotSaneError is returned by ErrorIfNotSane() if a path isn't absolute.
func (PathNotSaneError) Error ¶
func (p PathNotSaneError) Error() string
Err serializes the PathNotSaneError.
Click to show internal directories.
Click to hide internal directories.