mirror of
https://gitee.com/goploy/goploy.git
synced 2024-12-02 12:10:05 +08:00
20 lines
385 B
Go
20 lines
385 B
Go
// Copyright 2022 The Goploy Authors. All rights reserved.
|
|
// Use of this source code is governed by a GPLv3-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package response
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type Redirect struct {
|
|
URL string
|
|
Code int
|
|
}
|
|
|
|
func (rdr Redirect) Write(w http.ResponseWriter, r *http.Request) error {
|
|
http.Redirect(w, r, rdr.URL, rdr.Code)
|
|
return nil
|
|
}
|