Verify if request date is 5minutes late, reject such a request as

it could be a possible replay attack.

This commit also fixes #505, by returning MethodNotAllowed instead of NotImplemented
This commit is contained in:
Harshavardhana
2015-04-27 03:54:49 -07:00
parent 1531802b73
commit ade803a923
5 changed files with 73 additions and 16 deletions
+3 -1
View File
@@ -92,7 +92,9 @@ func HTTPHandler(domain string, driver drivers.Driver) http.Handler {
log.Fatal(iodine.New(err, map[string]string{"domain": domain}))
}
h := validateHandler(conf, ignoreResourcesHandler(mux))
h := timeValidityHandler(mux)
h = ignoreResourcesHandler(h)
h = validateRequestHandler(conf, h)
h = quota.BandwidthCap(h, 25*1024*1024, time.Duration(30*time.Minute))
h = quota.BandwidthCap(h, 100*1024*1024, time.Duration(24*time.Hour))
h = quota.RequestLimit(h, 100, time.Duration(30*time.Minute))