<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div class="" style=""><span class="" style="">Content Length auto detection was moved from Catalyst core to middleware in a recent build of Catalyst. &nbsp;Its likely that the view you are using isn't bothering to set the length and the middleware is failing to provide it properly since the Head middleware has already removed it.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span class="" style=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal"
 class=""><span class="" style="">Since the content length SHOULD be provided for the case of HEAD, could you provide a test case and lets see if shuffling the order of the registered middleware fixes this problem?</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span class="" style=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span class="" style="">There's a method called 'registered_middlewares' in Catalyst.pm that dictates the order. &nbsp;If you can provide me a failing test case in the repo (https://github.com/perl-catalyst/catalyst-runtime) I am sure I could fix it pretty
 quick.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span class="" style=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span class="" style="">Sorry for the slow response, BTW, there's also middleware for the md5</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span class="" style=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial,
 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span class="" style=""><a href="https://metacpan.org/pod/Plack::Middleware::ContentMD5" class="" style="">Plack::Middleware::ContentMD5 - Automatically sets the Content-MD5 header on all String bodies - metacpan.org</a><br class="" style=""></span></div><div style="width:450px; font-family: 'Georgia', 'Times', 'Times New Roman', 'serif';" contenteditable="false" id="enhancrCard_0" class="link-enhancr-attachment link-enhancr-element"><table class="link-enhancr-element" cellspacing="0" cellpadding="0" style="width:450px; height:auto; position: relative; margin-top:5px; margin-bottom: 5px; display: block;"><tbody><tr class="link-enhancr-element"><td colspan="6" class="link-enhancr-element" style="height: 1px; background-color: #e5e5e5;"><div class="link-enhancr-element" style="height: 1px; background-color: #e5e5e5;"></div></td></tr><tr
 class="link-enhancr-element"><td rowspan="2" class="link-enhancr-element" style="width: 1px; background-color: #e5e5e5;"><div class="link-enhancr-element" style="width: 1px; background-color: #e5e5e5;"></div></td><td class="link-enhancr-element" colspan="2" style="width: 100%; vertical-align: middle; font-family: 'Georgia', 'Times', 'Times New Roman', 'serif';"><div class="link-enhancr-text-part link-enhancr-element" style="line-height:16.5px; background-color: #ffffff;  width: 448px;"><div class="link-enhancr-element" style="word-wrap: break-word; padding: 7px 20px 0px 14px;"><span class="link-enhancr-element icon  icon-shrink link-enhancr-toggle"></span><span class="link-enhancr-element icon icon-close link-enhancr-delete"></span><a href="https://metacpan.org/pod/Plack::Middleware::ContentMD5" class="link-enhancr-card-urlWrapper link-enhancr-element" style="text-decoration: none !important; color: #000000 !important;"><span class="link-enhancr-element
 link-enhancr-card-title" style="margin: 0; font-weight: normal;margin-bottom: 4px; font-size: 18px; line-height: 21px; max-height: 43px; color: #000000; overflow: hidden !important; display: inline-block;">Plack::Middleware::ContentMD5 - Automatically sets the Content-MD5 header on all String bodies...</span></a><div style="font-size: 13px; line-height: 20px; color: #999999; max-height: 81px; font-family: 'Georgia', 'Times', 'Times New Roman', 'serif';overflow: hidden;" class="link-enhancr-card-description link-enhancr-element">Automatically sets the Content-MD5 header on all String bodies</div></div></div></td><td class="link-enhancr-element" rowspan="2" style="width: 1px; background-color: #e5e5e5;"><div class="link-enhancr-element" style="width: 1px; background-color: #e5e5e5;"></div></td></tr><tr><td class="link-enhancr-element" style="width: 100%; vertical-align: middle; font-family: 'Arial', 'Helvetica Neue', 'Helvetica', 'sans-serif';"><div
 class="link-enhancr-element" style="font-size: 0pt; padding: 3px 20px 9px 14px;"><a href="https://metacpan.org/pod/Plack::Middleware::ContentMD5" class="link-enhancr-card-url link-enhancr-element" style="color: black; text-decoration: none !important;cursor:pointer !important;" target="_blank"><span class="link-enhancr-element link-enhancr-view-on" style="display: inline-block; line-height: 11px; max-width: 348px; min-width: 288px; overflow: hidden; max-height: 13px; word-break: break-all;"><span class="link-enhancr-element link-enhancr-mobile-no-resize" style="vertical-align:middle; font-size: 9px; line-height: 11px; color: #999999; -moz-text-size-adjust: none; -ms-text-size-adjust: none; -webkit-text-size-adjust:none; text-size-adjust:none;">View on <span style="font-weight: bold" class="link-enhancr-view-on-domain">metacpan.org</span></span></span></a></div></td><td class="link-enhancr-element" style="vertical-align: middle; width: 100px;
 font-family: 'Arial', 'Helvetica Neue', 'Helvetica', 'sans-serif';"><div class="link-enhancr-element link-enhancr-preview-wrapper" style="padding: 6px 20px 12px 0px; max-width: 100px; min-width: 80px; overflow: hidden; text-align: right; line-height: 11px; max-height: 13px; font-size: 0pt;"><span class="link-enhancr-element link-enhancr-preview-by link-enhancr-mobile-no-resize" style="vertical-align:middle; font-size: 9px; line-height: 11px; color: #999999; -moz-text-size-adjust: none; -ms-text-size-adjust: none; -webkit-text-size-adjust:none; text-size-adjust:none;">Preview by Yahoo</span></div></td></tr><tr class="link-enhancr-element"><td class="link-enhancr-element" colspan="6" style="height: 1px; background-color: #e5e5e5;"><div class="link-enhancr-element" style="height: 1px; background-color: #e5e5e5;"></div></td></tr></tbody></table></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
 Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class=""><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class="">I could be talked into adding that as well, although maybe not everyone wants the overhead.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class=""><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class="">Any thoughts on that? &nbsp;--jnap</div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica
 Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt" class=""> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt" class=""> <div dir="ltr" class="" style=""> <font size="2" face="Arial" class="" style=""> On Wednesday, April 23, 2014 6:50 PM, Trevor Leffler &lt;tleffler@uw.edu&gt; wrote:<br class="" style=""> </font> </div>  <div class="" style="">I've been playing with a toy application and inspecting its responses to <br class="" style="">various HTTP methods and noticed that Content-Length is missing from the <br class="" style="">HEAD response.&nbsp; Both Catalyst::Action::RenderView and C::A::Serialize <br class="" style="">(from the C::A::REST package) seem to take the easy way out and "return <br class="" style="">1 if $c-&gt;req-&gt;method eq 'HEAD'".&nbsp; Does anyone with CAR history know why <br class="" style="">this is?<br class="" style=""><br class=""
 style="">To provide message-body-based headers (content-length, last-modified, <br class="" style="">content-md5, etc) I'm doing this:<br class="" style=""><br class="" style="">sub render : ActionClass('RenderView') { }<br class="" style=""><br class="" style="">sub end : Private {<br class="" style="">&nbsp;  my $self = shift;<br class="" style="">&nbsp;  my ($c) = @_;<br class="" style=""><br class="" style="">&nbsp;  $c-&gt;forward('render');<br class="" style=""><br class="" style="">&nbsp;  # see also Catalyst::Action::RenderView or ::Serialize<br class="" style="">&nbsp;  if ($c-&gt;req-&gt;method eq 'HEAD') {<br class="" style="">&nbsp; &nbsp;  my $view = $c-&gt;view<br class="" style="">&nbsp; &nbsp; &nbsp;  || die sprintf("%s could not find a view to forward to.\n", <br class="" style="">__PACKAGE__);<br class="" style="">&nbsp; &nbsp;  $c-&gt;forward($view);<br class="" style="">&nbsp;  }<br class="" style=""><br class="" style="">&nbsp;  #
 fun with headers, for example...<br class="" style="">&nbsp;  # or enable P::M::ContentMD5<br class="" style="">&nbsp;  if ($c-&gt;res-&gt;has_body) {<br class="" style="">&nbsp; &nbsp;  my $md5 = Digest::MD5::md5_hex($c-&gt;res-&gt;body);<br class="" style="">&nbsp; &nbsp;  $c-&gt;res-&gt;headers-&gt;header(Content-MD5 =&gt; $md5);<br class="" style="">&nbsp;  }<br class="" style="">}<br class="" style=""><br class="" style="">I've noted that while $c-&gt;res-&gt;body now has my rendered view, it gets <br class="" style="">removed by Plack::Middleware::Head prior to returning the response, so I <br class="" style="">don't have to worry about that detail.<br class="" style=""><br class="" style="">--Trevor<br class="" style=""><br class="" style="">_______________________________________________<br class="" style="">List: <a ymailto="mailto:Catalyst@lists.scsys.co.uk" href="mailto:Catalyst@lists.scsys.co.uk" class=""
 style="">Catalyst@lists.scsys.co.uk</a><br class="" style="">Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank" class="" style="">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br class="" style="">Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank" class="" style="">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br class="" style="">Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank" class="" style="">http://dev.catalyst.perl.org/</a><br class="" style=""><br class="" style=""><br class="" style=""></div>  </div> </div>  </div> </div></body></html>