diff options
author | Thomas Voss <mail@thomasvoss.com> | 2021-10-12 18:51:01 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2021-10-12 18:51:01 +0200 |
commit | 113120aa32fb6eac38d396fee1ee9fc60006d8ac (patch) | |
tree | 854ba98d29fc33275dca0ef3d3df32a9bac11296 | |
parent | 11a2560513e114ae30904f0598c4732aeac1972a (diff) |
[mpaste] Bug fixes
-rw-r--r-- | mpaste.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -178,6 +178,7 @@ func endpoint(w http.ResponseWriter, r *http.Request) { } mutex.Lock() + defer mutex.Unlock() fname := file_prefix + strconv.Itoa(counter) nfile, err := os.Create(fname) @@ -198,7 +199,6 @@ func endpoint(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, domain+"/%d\n", counter) counter++ - mutex.Unlock() default: WRITE_HEADER(http.StatusMethodNotAllowed, "Only GET and POST requests are supported") } @@ -233,6 +233,10 @@ func main() { file_prefix += "/" } + if counter_file == "" { + counter_file = "counter" + } + if index_file == "" { index_file = "index.html" } |