コード例 #1
0
ファイル: goweb_http_responder.go プロジェクト: MG-RAST/Shock
// 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...))
}