forked from jason/cpolis
Deleted ServePDFs() and added ServePDF()
This commit is contained in:
@ -5,7 +5,6 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
b "streifling.com/jason/cpolis/cmd/backend"
|
||||
)
|
||||
@ -60,15 +59,10 @@ func ServePDFList(c *b.Config) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
func ServePDFs(c *b.Config) http.HandlerFunc {
|
||||
func ServePDF(c *b.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
if tokenIsVerified(w, r) {
|
||||
pdfIDsString := r.PathValue("ids")
|
||||
pdfIDs := strings.Split(pdfIDsString, ",")
|
||||
|
||||
for _, id := range pdfIDs {
|
||||
http.ServeFile(w, r, id)
|
||||
}
|
||||
http.ServeFile(w, r, r.PathValue("id"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user