mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
Merge pull request #8440 from gklp/gklp_issue_8197_wrong_header_content_type_after_redirection
All redirect operations should have content-type as json
This commit is contained in:
commit
f491061b57
@ -155,6 +155,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