mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-24 00:21:29 +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
|
requestURI := b.Ctx.Request.RequestURI
|
||||||
resourceURI := requestURI + "/" + resouceID
|
resourceURI := requestURI + "/" + resouceID
|
||||||
|
|
||||||
b.Ctx.ResponseWriter.Header().Set("Content-Type", "application/json")
|
|
||||||
b.Ctx.Redirect(statusCode, resourceURI)
|
b.Ctx.Redirect(statusCode, resourceURI)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,6 +161,10 @@ func (r *RobotAPI) Post() {
|
|||||||
Name: robot.Name,
|
Name: robot.Name,
|
||||||
Token: rawTk,
|
Token: rawTk,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w := r.Ctx.ResponseWriter
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
r.Redirect(http.StatusCreated, strconv.FormatInt(id, 10))
|
r.Redirect(http.StatusCreated, strconv.FormatInt(id, 10))
|
||||||
r.Data["json"] = robotRep
|
r.Data["json"] = robotRep
|
||||||
r.ServeJSON()
|
r.ServeJSON()
|
||||||
|
Loading…
Reference in New Issue
Block a user