mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
Make snapshot diff GET, not POST (as it doesn't change anything in the system). #168
This commit is contained in:
+1
-1
@@ -65,7 +65,7 @@ func Router(c *ctx.AptlyContext) http.Handler {
|
|||||||
root.GET("/snapshots/:name", apiSnapshotsShow)
|
root.GET("/snapshots/:name", apiSnapshotsShow)
|
||||||
root.GET("/snapshots/:name/packages", apiSnapshotsSearchPackages)
|
root.GET("/snapshots/:name/packages", apiSnapshotsSearchPackages)
|
||||||
root.DELETE("/snapshots/:name", apiSnapshotsDrop)
|
root.DELETE("/snapshots/:name", apiSnapshotsDrop)
|
||||||
root.POST("/snapshots/:name/diff/:withSnapshot", apiSnapshotsDiff)
|
root.GET("/snapshots/:name/diff/:withSnapshot", apiSnapshotsDiff)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -333,7 +333,7 @@ func apiSnapshotsDrop(c *gin.Context) {
|
|||||||
c.JSON(200, gin.H{})
|
c.JSON(200, gin.H{})
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST /api/snapshots/:name/diff/:name2
|
// GET /api/snapshots/:name/diff/:withSnapshot
|
||||||
func apiSnapshotsDiff(c *gin.Context) {
|
func apiSnapshotsDiff(c *gin.Context) {
|
||||||
onlyMatching := c.Request.URL.Query().Get("onlyMatching") == "1"
|
onlyMatching := c.Request.URL.Query().Get("onlyMatching") == "1"
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class SnapshotsAPITestDiff(APITest):
|
|||||||
resp = self.post("/api/snapshots", json={'Name': snapshots[1]})
|
resp = self.post("/api/snapshots", json={'Name': snapshots[1]})
|
||||||
self.check_equal(resp.status_code, 201)
|
self.check_equal(resp.status_code, 201)
|
||||||
|
|
||||||
resp = self.post("/api/snapshots/" + snapshots[0] + "/diff/" + snapshots[1])
|
resp = self.get("/api/snapshots/" + snapshots[0] + "/diff/" + snapshots[1])
|
||||||
|
|
||||||
self.check_equal(resp.status_code, 200)
|
self.check_equal(resp.status_code, 200)
|
||||||
self.check_subset({"Right": None}, resp.json()[0])
|
self.check_subset({"Right": None}, resp.json()[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user