Documentation ¶
Index ¶
- func GetBaseURL(r *http.Request, s string) (string, string)
- func GetContentType(r *http.Request) string
- func GetCurrentBaseURL(r *http.Request) string
- func GetCurrentURL(r *http.Request) string
- func GetIssuerURL(r *http.Request) string
- func GetRandomEncodedStringFromRange(a, b int) string
- func GetRandomString(i int) string
- func GetRandomStringFromRange(a, b int) string
- func GetRandomStringFromRangeWithCharset(a, b int, cs string) string
- func GetRelativeURL(r *http.Request, orig, repl string) string
- func GetRequestID(r *http.Request) string
- func IsMalformedRandomString(s string, a, b int) bool
- func ParseCredentials(r *http.Request) (map[string]string, error)
- func ParseIdentity(r *http.Request) (map[string]string, error)
- func SanitizeSessionID(s string) string
- func SanitizeURL(s string) string
- func StripQueryParam(url string, param string) string
- type Browser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBaseURL ¶
GetBaseURL returns base path based on some match.
func GetContentType ¶
GetContentType returns requested content type.
func GetCurrentBaseURL ¶
GetCurrentBaseURL returns current base URL.
func GetRandomEncodedStringFromRange ¶
GetRandomEncodedStringFromRange return the number returned by GetRandomStringFromRange() and encoded with Base32
func GetRandomString ¶
GetRandomString returns X character long random string.
func GetRandomStringFromRange ¶
GetRandomStringFromRange generates random string of a random length. The random lenght is bounded by a and b.
func GetRandomStringFromRangeWithCharset ¶
GetRandomStringFromRangeWithCharset generates random string of a random length. The random lenght is bounded by a and b. The charset is provided.
func GetRelativeURL ¶
GetRelativeURL returns relative path to current URL.
func IsMalformedRandomString ¶ added in v1.0.23
IsMalformedRandomString checks whether the provided string was generated by the GetRandomStringFromRange() function.
func ParseCredentials ¶
ParseCredentials extracts credentials from HTTP request.
func ParseIdentity ¶
ParseIdentity extracts user id/email and optional authentication realm from HTTP request.
func SanitizeSessionID ¶ added in v1.0.23
SanitizeSessionID sanitizes provided Session ID.
func SanitizeURL ¶ added in v1.0.27
SanitizeURL escapes some invalid characters than can allow for Cross Site Scripting
func StripQueryParam ¶
StripQueryParam removes a specific query parameter from a URL.
Types ¶
type Browser ¶ added in v1.0.17
type Browser struct {
// contains filtered or unexported fields
}
Browser represents a browser instance.
func NewBrowser ¶ added in v1.0.17
NewBrowser returns an instance of a browser.