WIP
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/play-with-docker/play-with-docker/services"
|
||||
)
|
||||
|
||||
func FileUpload(rw http.ResponseWriter, req *http.Request) {
|
||||
@@ -13,14 +12,14 @@ func FileUpload(rw http.ResponseWriter, req *http.Request) {
|
||||
sessionId := vars["sessionId"]
|
||||
instanceName := vars["instanceName"]
|
||||
|
||||
s := services.GetSession(sessionId)
|
||||
i := services.GetInstance(s, instanceName)
|
||||
s := core.SessionGet(sessionId)
|
||||
i := core.InstanceGet(s, instanceName)
|
||||
|
||||
// allow up to 32 MB which is the default
|
||||
|
||||
// has a url query parameter, ignore body
|
||||
if url := req.URL.Query().Get("url"); url != "" {
|
||||
err := i.UploadFromURL(req.URL.Query().Get("url"))
|
||||
err := core.InstanceUploadFromUrl(i, req.URL.Query().Get("url"))
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
rw.WriteHeader(http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user