diff --git a/delete.go b/delete.go index 38e36e3..b2d0ad7 100644 --- a/delete.go +++ b/delete.go @@ -10,9 +10,13 @@ import ( func deleteHandler(c web.C, w http.ResponseWriter, r *http.Request) { requestKey := r.Header.Get("Linx-Delete-Key") - + urlRequestKey := r.URL.Query().Get("linx-delete-key") + if len(urlRequestKey) > 0 { + requestKey := urlRequestKey + } + filename := c.URLParams["name"] - + // Ensure that file exists and delete key is correct metadata, err := storageBackend.Head(filename) if err == backends.NotFoundErr { diff --git a/put.icu.sxcu b/put.icu.sxcu new file mode 100644 index 0000000..99fa524 --- /dev/null +++ b/put.icu.sxcu @@ -0,0 +1,11 @@ +{ + "Version": "13.1.0", + "DestinationType": "ImageUploader, FileUploader", + "RequestMethod": "PUT", + "RequestURL": "https://put.icu/upload/", + "Headers": { + "Accept": "application/json" + }, + "Body": "Binary", + "URL": "$json:url$" +} \ No newline at end of file diff --git a/server.go b/server.go index 7c56639..fcce5ce 100644 --- a/server.go +++ b/server.go @@ -212,7 +212,9 @@ func setup() *web.Mux { mux.Put(Config.sitePath+"upload/:name", uploadPutHandler) mux.Delete(Config.sitePath+":name", deleteHandler) - + // Adding new delete path method to make linx-server usable with ShareX. + mux.Get(Config.sitePath+"delete/:name", deleteHandler) + mux.Get(Config.sitePath+"static/*", staticHandler) mux.Get(Config.sitePath+"favicon.ico", staticHandler) mux.Get(Config.sitePath+"robots.txt", staticHandler)