Allow uppercasing and less rigide sanitizing of filenames, fixes #10

This commit is contained in:
Remco
2017-03-23 11:46:59 +01:00
parent 964e8c92d7
commit 45bafbe48f
3 changed files with 12 additions and 12 deletions

View File

@ -29,18 +29,17 @@ import (
"io"
"log"
"net/http"
"path/filepath"
_ "github.com/PuerkitoBio/ghost/handlers"
"github.com/dutchcoders/go-virustotal"
"github.com/gorilla/mux"
"github.com/kennygrant/sanitize"
virustotal "github.com/dutchcoders/go-virustotal"
)
func (s *Server) virusTotalHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
filename := sanitize.Path(filepath.Base(vars["filename"]))
filename := sanitize(vars["filename"])
contentLength := r.ContentLength
contentType := r.Header.Get("Content-Type")