Browse Source

Cleanup code and improve error messages

tags/v1.0.0
Remco 7 years ago
parent
commit
8ec4d5dbb7
2 changed files with 2 additions and 3 deletions
  1. +1
    -1
      server/handlers.go
  2. +1
    -2
      server/server.go

+ 1
- 1
server/handlers.go View File

@@ -290,7 +290,7 @@ func (s *Server) putHandler(w http.ResponseWriter, r *http.Request) {

n, err := io.CopyN(&b, f, _24K+1)
if err != nil && err != io.EOF {
log.Printf("%s", err.Error())
log.Printf("Error putting new file: %s", err.Error())
http.Error(w, err.Error(), 500)
return
}


+ 1
- 2
server/server.go View File

@@ -132,7 +132,6 @@ func UseLetsEncrypt(hosts []string) OptionFn {
found := false

for _, h := range hosts {
fmt.Println(h)
found = found || strings.HasSuffix(host, h)
}

@@ -294,7 +293,7 @@ func (s *Server) Run() {

mime.AddExtensionType(".md", "text/x-markdown")

log.Printf("Transfer.sh server started. :\nlistening on port: %v\nusing temp folder: %s\nusing storage provider: %s", s.ListenerString, s.tempPath, s.storage.Type())
log.Printf("Transfer.sh server started.\nlistening on port: %v\nusing temp folder: %s\nusing storage provider: %s", s.ListenerString, s.tempPath, s.storage.Type())
log.Printf("---------------------------")

h := handlers.PanicHandler(handlers.LogHandler(LoveHandler(s.RedirectHandler(r)), handlers.NewLogOptions(log.Printf, "_default_")), nil)


Loading…
Cancel
Save