There is a link that is not matching "Media type not detected" in Response cycle because the media type is detected: text/xml
List.OfMediaType.IsEmpty(MediaType.EnsuredTypes) = false
However, the link is blocked because in the "Response Embedded"cyle, the media type is not detected.
List.OfMediaType.IsEmpty(MediaType.EnsuredTypes) = true
Could someone explain me what is happening here ?
I've read about Composite Opener, Embedded cycles etc, but I cannot find a logic reason why media type is not detected
Hope you are doing well.
Media type ensured is better. MWG has a list of byte sequences and other matching criteria that allows it to make a guess at the file type. Generally it's pretty good. However there are two concerns with it. One is that it is a guess. If the probability is over 70% we list it otherwise, there is nothing. Many formats are notoriously difficult as they have no set format. Txt files are a good example of a file that may or may not have a probability over 70%. The second issue is that mediatype.ensured is a list instead of a single answer, as more than one format could be probable. This means that you could end up with a number of mediatypes listed.
If possible can you provide the link for me to test the behavior at my end?
thanks for the quick reply.
What is strange for me is: the EnsureType is detected in the Response cycle, but for the same file the EnsureType is not detected in ResponseEmbedded cycle.
However, it's the same file.
here are the links:
after some more troubleshooting, I've managed to see the blocking page
where I saw this messag:
File Name: database_2.xml|xml-base64-text-obj-917566892
So there is some base64 encoded data in that XML that is starting the Embedded cycle. (this answer to my question why having Embedded Cycle for XML file)
Now, as you said, EnsuredType is not 100% reliable. This explain missing the base64 type detection.
OK. I've tested with PDF file and managed to reproduce the same error - MediaType not detected in Embedded Cycle.
File Name: test.pdf|pdf-obj-109-0.dat|xml-base64-attribute-obj-706600083
My question is: what is the best practice ? how to configure MWG for this situations ?