add asf to test-unexpected-eos
refactor detectMediaType to add a check for length