2

I am regularly seeing exceptions show up in my Sitecore log file as follows:

at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles\ styles)
at Sitecore.Resources.Media.MediaRequestHandler.Modified(HttpContext context,\ Media media, MediaOptions options)
at Sitecore.Resources.Media.MediaRequestHandler.DoProcessRequest(HttpContext\ context, MediaRequest request, Media media)
at Sitecore.Resources.Media.MediaRequestHandler.DoProcessRequest(HttpContext\ context)
at Sitecore.Resources.Media.MediaRequestHandler.ProcessRequest(HttpContext\ context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I am using Sitecore 6.1

I realise there are a number of posts highlighting this is usually caused by incorrect date formatting or by having a string which contains a date, and then a day of the week which is not correct for that date. What I am looking for is an understanding of what specifically causes the Sitecore MediaHandler to throw this error.

I'm not sure if this is signficant but under <handlers>I have

<add verb="*" path="sitecore_media.ashx" type="Sitecore.Resources.Media.MediaRequestHandler, Sitecore.Kernel" name="Sitecore.MediaRequestHandler" />

and under <httpHandlers>,

<add verb="*" path="sitecore_media.ashx" type="Sitecore.Resources.Media.MediaRequestHandler, Sitecore.Kernel" />
4

1 回答 1

3

Sitecore is trying to convert the date from the "If-Modified-Since" request header to a DateTime object but fails to do so.

In Sitecore v6.1.0 rev. 090821 (Update-2) this behavior has been fixed according to the change log: "Media requests would sometimes fail due to the browser sending an invalid "If-Modified-Since" header."

I can't find a Sitecore.Kernel.dll on the SDN for an older v6.1.0 so I can reflect the code and explain what they do wrong in your v6.1.0.

于 2013-04-17T06:15:30.033 回答