diff --git a/Makefile b/Makefile index c294f4b..961cbe1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION = 1.4.1 +VERSION = 1.4.2 APP := http-file-server PACKAGES := $(shell go list -f {{.Dir}} ./...) @@ -13,7 +13,6 @@ clean: # go get -u github.com/github/hub release: README.md zip - git reset git add README.md git add Makefile git commit -m "Release $(VERSION)" || true diff --git a/README.md b/README.md index 4d34ba4..170ac6a 100644 --- a/README.md +++ b/README.md @@ -60,14 +60,14 @@ Or [download a binary](https://github.com/sgreben/http-file-server/releases/late ```sh # Linux -curl -L https://github.com/sgreben/http-file-server/releases/download/1.4.1/http-file-server_1.4.1_linux_x86_64.tar.gz | tar xz +curl -L https://github.com/sgreben/http-file-server/releases/download/1.4.2/http-file-server_1.4.2_linux_x86_64.tar.gz | tar xz # OS X -curl -L https://github.com/sgreben/http-file-server/releases/download/1.4.1/http-file-server_1.4.1_osx_x86_64.tar.gz | tar xz +curl -L https://github.com/sgreben/http-file-server/releases/download/1.4.2/http-file-server_1.4.2_osx_x86_64.tar.gz | tar xz # Windows -curl -LO https://github.com/sgreben/http-file-server/releases/download/1.4.1/http-file-server_1.4.1_windows_x86_64.zip -unzip http-file-server_1.4.1_windows_x86_64.zip +curl -LO https://github.com/sgreben/http-file-server/releases/download/1.4.2/http-file-server_1.4.2_windows_x86_64.zip +unzip http-file-server_1.4.2_windows_x86_64.zip ``` ## Use it diff --git a/server.go b/server.go index 0ebd508..e635b21 100644 --- a/server.go +++ b/server.go @@ -246,7 +246,7 @@ func (f *fileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { f.serveZip(w, r, osPath) case r.URL.Query().Get(tarGzKey) != "": f.serveTarGz(w, r, osPath) - case info.IsDir() && r.Method == http.MethodPost: + case f.allowUpload && info.IsDir() && r.Method == http.MethodPost: f.serveUploadTo(w, r, osPath) case info.IsDir(): f.serveDir(w, r, osPath)