mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-07 08:27:43 +01:00
refactored
Signed-off-by: gklp <gokalpkuscu@gmail.com>
This commit is contained in:
parent
44a9e5d127
commit
dee3defeff
@ -112,7 +112,6 @@ func (b *BaseAPI) Redirect(statusCode int, resouceID string) {
|
||||
requestURI := b.Ctx.Request.RequestURI
|
||||
resourceURI := requestURI + "/" + resouceID
|
||||
|
||||
b.Ctx.ResponseWriter.Header().Set("Content-Type", "application/json")
|
||||
b.Ctx.Redirect(statusCode, resourceURI)
|
||||
}
|
||||
|
||||
|
@ -161,6 +161,10 @@ func (r *RobotAPI) Post() {
|
||||
Name: robot.Name,
|
||||
Token: rawTk,
|
||||
}
|
||||
|
||||
w := r.Ctx.ResponseWriter
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
r.Redirect(http.StatusCreated, strconv.FormatInt(id, 10))
|
||||
r.Data["json"] = robotRep
|
||||
r.ServeJSON()
|
||||
|
Loading…
Reference in New Issue
Block a user