We had to implement the bloking Media type rule because some users are downloading Mkv file from office, witch is illegal. Is there a rule parameter to block immediately the download? MKV are big-size file, and we don't want the end of the download to block the file.
In fact, the Media Type filtering don't detect Mkv files, i can see in the rule trace that Media type is not matching any of the Video list.... useless....
you can easily block all downloads with file extension .mkv. (property URL.Fileextension)
in combination with body.size or header.response (Content-Length)... you can deny downloads for files which exceeds a predefined size...
You can also use the MediaType.FromHeader property. In this case it evaluates to video/x-matroska.
With videos sometimes the EnsuredMediaType property doesn't have enough information to say if it can ensure it's that particular media type. This is where MediaType.FromHeader is useful.