You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http.Error(w, "This server does not accept rageshakes from your application. See https://github.com/matrix-org/rageshake/blob/master/docs/blocked_rageshake.md", 400)
223
226
return
224
227
}
228
+
ifs.cfg.matchesRejectionCondition(p) {
229
+
log.Printf("Blocking rageshake from app %s because it matches a rejection_condition", p.AppName)
230
+
iferr:=os.RemoveAll(reportDir); err!=nil {
231
+
log.Printf("Unable to remove report dir %s after rejected upload: %v\n",
232
+
reportDir, err)
233
+
}
234
+
http.Error(w, "This server does not accept rageshakes from your application + version. See https://github.com/matrix-org/rageshake/blob/master/docs/blocked_rageshake.md", 400)
235
+
return
236
+
}
225
237
226
238
// We use this prefix (eg, 2022-05-01/125223-abcde) as a unique identifier for this rageshake.
227
239
// This is going to be used to uniquely identify rageshakes, even if they are not submitted to
@@ -422,15 +434,15 @@ func formPartToPayload(field, data string, p *payload) {
422
434
423
435
// we use a quite restrictive regexp for the filenames; in particular:
424
436
//
425
-
// * a limited set of extensions. We are careful to limit the content-types
426
-
// we will serve the files with, but somebody might accidentally point an
427
-
// Apache or nginx at the upload directory, which would serve js files as
428
-
// application/javascript and open XSS vulnerabilities. We also allow gzipped
429
-
// text and json on the same basis (there's really no sense allowing gzipped images).
437
+
// - a limited set of extensions. We are careful to limit the content-types
438
+
// we will serve the files with, but somebody might accidentally point an
439
+
// Apache or nginx at the upload directory, which would serve js files as
440
+
// application/javascript and open XSS vulnerabilities. We also allow gzipped
441
+
// text and json on the same basis (there's really no sense allowing gzipped images).
0 commit comments