示例#1
0
// WithPermanentRedirect responds with a redirection to the specific path or URL with the
// http.StatusMovedPermanently status.
func (r *GowebHTTPResponder) WithPermanentRedirect(ctx context.Context, pathOrURLSegments ...interface{}) error {
	ctx.HttpResponseWriter().Header().Set("Location", paths.PathFromSegments(pathOrURLSegments...))
	return r.WithStatus(ctx, http.StatusMovedPermanently)
}
示例#2
0
文件: helpers.go 项目: MG-RAST/Shock
// RedirectTo writes the Location header.
func RedirectTo(response http.ResponseWriter, pathOrURLSegments ...interface{}) {
	response.Header().Set(headerKeyLocation, paths.PathFromSegments(pathOrURLSegments...))
}