Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReplaceTilde ¶
func ReplaceTilde(replacement string) sr.Middleware
ReplaceTilde builds a middleware which substitutes a leading '~' in the request path.
It makes the alteration to a copy of the request which is then passed into the wrapped Handler. This way middlewares outside of this one inspecting the request afterwards will see the original URL.
Typically the replacement should end with a "/", so that the ~ ends up mapping to a particular directory on the filesystem. For instance with a replacement string of "users/", "domain.com/~jim/index.gmi" maps to "domain.com/users/jim/index.gmi".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.