pass a struct with the info

This commit is contained in:
Henrique Dias committed 2017-06-27 09:57:11 +01:00
1 parent 3b3643be05
commit 1d26b8e95e
12 files changed
+79 -70

No files matched your search

+2 -2
View File
@@ -14,10 +14,10 @@ import (
)
// checksum calculates the hash of a file. Supports MD5, SHA1, SHA256 and SHA512.
func checksum(w http.ResponseWriter, r *http.Request, i *fileInfo) (int, error) {
func checksum(ctx *requestContext, w http.ResponseWriter, r *http.Request) (int, error) {
query := r.URL.Query().Get("checksum")
file, err := os.Open(i.Path)
file, err := os.Open(ctx.Info.Path)
if err != nil {
return errorToHTTP(err, true), err
}