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:
Roman Perekhod
2023-11-15 17:45:23 +01:00
committed by GitHub
co-authored by Roman Perekhod
parent 71b596e947
commit a6b75bc9f6
13 changed files with 55 additions and 40 deletions
+1 -1
View File
@@ -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)
}
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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)
}
+4 -4
View File
@@ -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))
})
})