package middleware import ( "fmt" "git.urbach.dev/go/web" ) func Canonical(ctx web.Context) error { ctx.Response().SetHeader("Link", fmt.Sprintf(`; rel="canonical"`, ctx.Request().Path())) return ctx.Next() }