fix libre-graph status codes (#7705)
* fix libre-graph status codes * owncloud-test-middleware bumped --------- Co-authored-by: Roman Perekhod <rperekhod@owncloud.com>
This commit is contained in:
co-authored by
Roman Perekhod
parent
71b596e947
commit
a6b75bc9f6
@@ -97,7 +97,7 @@ func (g Graph) PostGroup(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
g.publishEvent(r.Context(), e)
|
||||
}
|
||||
render.Status(r, http.StatusOK) // FIXME 201 should return 201 created
|
||||
render.Status(r, http.StatusCreated)
|
||||
render.JSON(w, r, grp)
|
||||
}
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ var _ = Describe("Groups", func() {
|
||||
|
||||
svc.PostGroup(rr, r)
|
||||
|
||||
Expect(rr.Code).To(Equal(http.StatusOK))
|
||||
Expect(rr.Code).To(Equal(http.StatusCreated))
|
||||
})
|
||||
})
|
||||
Describe("PatchGroup", func() {
|
||||
|
||||
@@ -87,7 +87,7 @@ func (g Graph) ExportPersonalData(w http.ResponseWriter, r *http.Request) {
|
||||
// go start gathering
|
||||
go g.GatherPersonalData(u, ref, r.Header.Get(revactx.TokenHeader), marsh)
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
w.WriteHeader(http.StatusAccepted)
|
||||
}
|
||||
|
||||
// GatherPersonalData will all gather all personal data of the user and save it to a file in the users personal space
|
||||
|
||||
@@ -347,7 +347,7 @@ func (g Graph) PostUser(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
g.publishEvent(r.Context(), e)
|
||||
|
||||
render.Status(r, http.StatusOK) // FIXME 201 should return 201 created
|
||||
render.Status(r, http.StatusCreated)
|
||||
render.JSON(w, r, u)
|
||||
}
|
||||
|
||||
|
||||
@@ -743,7 +743,7 @@ var _ = Describe("Users", func() {
|
||||
r = r.WithContext(revactx.ContextSetUser(ctx, currentUser))
|
||||
svc.PostUser(rr, r)
|
||||
|
||||
Expect(rr.Code).To(Equal(http.StatusOK))
|
||||
Expect(rr.Code).To(Equal(http.StatusCreated))
|
||||
data, err := io.ReadAll(rr.Body)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
@@ -768,7 +768,7 @@ var _ = Describe("Users", func() {
|
||||
r = r.WithContext(revactx.ContextSetUser(ctx, currentUser))
|
||||
svc.PostUser(rr, r)
|
||||
|
||||
Expect(rr.Code).To(Equal(http.StatusOK))
|
||||
Expect(rr.Code).To(Equal(http.StatusCreated))
|
||||
data, err := io.ReadAll(rr.Body)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
@@ -793,7 +793,7 @@ var _ = Describe("Users", func() {
|
||||
r = r.WithContext(revactx.ContextSetUser(ctx, currentUser))
|
||||
svc.PostUser(rr, r)
|
||||
|
||||
Expect(rr.Code).To(Equal(http.StatusOK))
|
||||
Expect(rr.Code).To(Equal(http.StatusCreated))
|
||||
data, err := io.ReadAll(rr.Body)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
@@ -854,7 +854,7 @@ var _ = Describe("Users", func() {
|
||||
r = r.WithContext(revactx.ContextSetUser(ctx, currentUser))
|
||||
newSvc("none").PostUser(rr, r)
|
||||
|
||||
Expect(rr.Code).To(Equal(http.StatusOK))
|
||||
Expect(rr.Code).To(Equal(http.StatusCreated))
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user