@@ -14,6 +14,10 @@ import (
14
14
"go.uber.org/zap"
15
15
)
16
16
17
+ const (
18
+ Version = "0.2"
19
+ )
20
+
17
21
func init () {
18
22
caddy .RegisterModule (Upload {})
19
23
httpcaddyfile .RegisterHandlerDirective ("upload" , parseCaddyfile )
@@ -54,8 +58,8 @@ func (u *Upload) Provision(ctx caddy.Context) error {
54
58
55
59
if u .DestDir == "" {
56
60
u .logger .Error ("Provision" ,
57
- zap .String ("msg" , "no Destinaton Directory specified (dest_dir)" ))
58
- return fmt .Errorf ("no Destinaton Directory specified (dest_dir)" )
61
+ zap .String ("msg" , "no Destination Directory specified (dest_dir)" ))
62
+ return fmt .Errorf ("no Destination Directory specified (dest_dir)" )
59
63
}
60
64
61
65
mdall_err := os .MkdirAll (u .DestDir , 0755 )
@@ -68,7 +72,7 @@ func (u *Upload) Provision(ctx caddy.Context) error {
68
72
69
73
if u .ResponseTemplate == "" {
70
74
u .logger .Warn ("Provision" ,
71
- zap .String ("msg" , "no ResponseTemplate specified (response_template), using the defualt one" ),
75
+ zap .String ("msg" , "no ResponseTemplate specified (response_template), using the default one" ),
72
76
)
73
77
u .ResponseTemplate = "upload-resp-template.txt"
74
78
}
@@ -164,7 +168,7 @@ func (u Upload) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp
164
168
// write this byte array to our temporary file
165
169
tempFile .Write (fileBytes )
166
170
167
- u .logger .Info ("Successfull Upload Info" ,
171
+ u .logger .Info ("Successful Upload Info" ,
168
172
zap .String ("Request uuid" , requuid ),
169
173
zap .String ("Uploaded File" , handler .Filename ),
170
174
zap .Int64 ("File Size" , handler .Size ),
@@ -179,7 +183,7 @@ func (u Upload) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp
179
183
}
180
184
181
185
if u .NotifyURL != "" {
182
- errNotify := u .SendNotify ()
186
+ errNotify := u .SendNotify (requuid )
183
187
184
188
if errNotify != nil {
185
189
u .logger .Error ("Notify Error" ,
0 commit comments