Remove more unused files, fix issue with CORS on /api/system, fix issue with GET /api/servers/:server/archive

This commit is contained in:
Matthew Penner
2020-04-06 14:39:33 -06:00
parent 718b126baf
commit f5a804210f
5 changed files with 35 additions and 98 deletions

View File

@@ -1,6 +1,7 @@
package router
import (
"bytes"
"github.com/gin-gonic/gin"
"github.com/pterodactyl/wings/installer"
"github.com/pterodactyl/wings/server"
@@ -30,10 +31,10 @@ func getAllServers(c *gin.Context) {
// Creates a new server on the wings daemon and begins the installation process
// for it.
func postCreateServer(c *gin.Context) {
var data []byte
c.Bind(&data)
buf := bytes.Buffer{}
buf.ReadFrom(c.Request.Body)
install, err := installer.New(data)
install, err := installer.New(buf.Bytes())
if err != nil {
TrackedError(err).
SetMessage("Failed to validate the data provided in the request.").
@@ -61,4 +62,4 @@ func postCreateServer(c *gin.Context) {
}(install)
c.Status(http.StatusAccepted)
}
}