URL redirection
Issue #120
new
This feature has two parts:
- An API to manage an association between a source URL and a forwarding URL.
- A method that performs the redirection by means of returning HTTP status code 302.
This is a prerequisite to Issue #118
Comments (4)
-
reporter -
reporter Reflecting on this, we need edit access control and we might as well make the struct generic.
type KeyValue struct {
Key string
Value string
Meta string
Owners []string
}
When used for URL forwarding:
Key is the “from” URL,
Value the “to” URL,
Meta is optional metadata (which could be “redirect” in this case), and
Owners is owner info, i.e., who is permitted to edit the struct.
-
Are these intended to be map keys at any point? If so, you can't have the
[]string
since slice types are not comparable. -
reporter No. I envisioned Owners would be a slice of email addresses or web domains granted write access to the struct.
- Log in to comment
I propose the following Forwarding struct for representing the association between a source URL and its forwarding URL:
type Forwarding struct {
From string
To string
}
A forward API method would update the association, i.e.., /api/forward/from/to
Omitting the final ‘to’ argument would disable the forwarding.