Procházet zdrojové kódy

bug fix , serve existing file before download...

master
Patrick Peng Sun před 8 roky
rodič
revize
d5bba6b4e1
1 změnil soubory, kde provedl 4 přidání a 5 odebrání
  1. +4
    -5
      crmcache.go

+ 4
- 5
crmcache.go Zobrazit soubor

@@ -29,6 +29,10 @@ func crmcache(w http.ResponseWriter, r *http.Request) {
id := attachmentid[0]
path := crmcacheFileName(id)

if isFileExist(path) {
http.ServeFile(w, r, path)
return
}
err = crmDownloadAttachmentAs(id, path)

if err != nil {
@@ -36,11 +40,6 @@ func crmcache(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "reference number is not right")
}

if isFileExist(path) {
http.ServeFile(w, r, path)
return
}

w.WriteHeader(http.StatusInternalServerError)
fmt.Fprintf(w, "cannot build reference cache")
}

Načítá se…
Zrušit
Uložit