Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ADDITIONAL_ALLOWED_SCHEME_CHARS = []rune{'-', '+', '.'}
As well as [a-z], these characters are allowed in URI schemes https://github.com/JuliaWeb/URIs.jl/blob/dce395c3/src/URIs.jl#L91-L108 TODO: handle user info and IPv6 hosts
var ADDITIONAL_ALLOWED_SCHEME_CHARS_PATTERN = additionalAllowedSchemeCharsPattern()
var SCHEME_PATTERN = schemePattern()
var UriSchemeMap = map[string]Scheme{}/* 384 elements not displayed */
Functions ¶
func DefangScheme ¶
The goal of defanging is to malform the URI such that it does not open if clicked.
However, as there is a *[re]fang* option in the Tomtils library, we need an algorithm to map invertibly fanged and defanged schemes. Many libraries do not support schemes beyond http[s] [1, 2], as browsers do not support many different schemes. However, it may be the case that different schemes are supported on different non-browser applications, so we *should* support defanging.
There is also consideration to have enough information in a defanged stream such that it is invertible* to its original scheme. Actually, not invertible, as there will not always be enough information just from the defanged scheme to reconstruct the scheme without having the list of valid schemes. So what we need is for the defanged scheme to be one-to-one, so that given a defanged scheme, you know that there is a single valid scheme.
Types ¶
type Scheme ¶
type Scheme struct { UriScheme string DefangedUriScheme string Template string Description string Status SchemeStatus `validate:"oneof=Permanent Provisional Historical"` WellKnownUriSupport string Reference string Notes string }
func (*Scheme) Validate ¶
Validate Scheme struct https://stackoverflow.com/a/71934231
type SchemeStatus ¶
type SchemeStatus string
Status types https://stackoverflow.com/a/71934535
const ( Permanent SchemeStatus = "Permanent" Provisional SchemeStatus = "Provisional" Historical SchemeStatus = "Historical" )