Pārlūkot izejas kodu

bugfix : after downloadingfile ,we still need to serve it..

master
Patrick Peng Sun pirms 8 gadiem
vecāks
revīzija
983c8273e8
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. +6
    -2
      crmcache.go

+ 6
- 2
crmcache.go Parādīt failu

@@ -7,7 +7,7 @@ import (
)

func crmcache(w http.ResponseWriter, r *http.Request) {
debugDumpHTTPRequest(r)
//debugDumpHTTPRequest(r)
if !checkSignatureByToken(r, IntraAPIConfig.CRMSecrete) {
w.WriteHeader(http.StatusUnauthorized)
fmt.Fprintf(w, "Expired or invalid link")
@@ -38,8 +38,12 @@ func crmcache(w http.ResponseWriter, r *http.Request) {
if err != nil {
w.WriteHeader(http.StatusNotFound)
fmt.Fprintf(w, "reference number is not right")
return
}
if isFileExist(path) {
http.ServeFile(w, r, path)
return
}

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

Notiek ielāde…
Atcelt
Saglabāt