<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>yes</td>
</tr>
<tr>
<td>Symfony version</td>
<td>&gt;2.3</td>
</tr>
</tbody>
</table>
<p dir="auto">Is there any reason this (snippet below) exists? the rfc does not require implementations to be identical, but that the responses be equivalent.</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="            // check HTTP method requirement
            if ($requiredMethods = $route-&gt;getMethods()) {
                // HEAD and GET are equivalent as per RFC
                if ('HEAD' === $method = $this-&gt;context-&gt;getMethod()) {
                    $method = 'GET';
                }
                if (!in_array($method, $requiredMethods)) {
                    $this-&gt;allow = array_merge($this-&gt;allow, $requiredMethods);
                    continue;
                }
            }"><pre class="notranslate">            <span class="pl-c">// check HTTP method requirement</span>
            <span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>requiredMethods</span> = <span class="pl-s1"><span class="pl-c1">$</span>route</span>-&gt;<span class="pl-en">getMethods</span>()) {
                <span class="pl-c">// HEAD and GET are equivalent as per RFC</span>
                <span class="pl-k">if</span> (<span class="pl-s">'HEAD'</span> === <span class="pl-s1"><span class="pl-c1">$</span>method</span> = <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">context</span>-&gt;<span class="pl-en">getMethod</span>()) {
                    <span class="pl-s1"><span class="pl-c1">$</span>method</span> = <span class="pl-s">'GET'</span>;
                }
                <span class="pl-k">if</span> (!in_array(<span class="pl-s1"><span class="pl-c1">$</span>method</span>, <span class="pl-s1"><span class="pl-c1">$</span>requiredMethods</span>)) {
                    <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">allow</span> = array_merge(<span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-c1">allow</span>, <span class="pl-s1"><span class="pl-c1">$</span>requiredMethods</span>);
                    <span class="pl-k">continue</span>;
                }
            }</pre></div>
<p dir="auto">Worse, in 2.3, what i am currently using (could be it's the same in higher versions), the router debug will actually not take this into consideration and report that the routing works as per the user routing definition</p>
<p dir="auto">There could be valid reasons to not want to execute the same code for GET and HEAD - f.e. avoid expensive hydration in exploratory HEAD calls.</p>
<p dir="auto">If the Content-Length defined in 14.13 is a factor here, that is expressed with SHOULD, not MUST, so no reason to impose this on the user.</p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>2.8.14</td>
</tr>
</tbody>
</table>
<p dir="auto">Related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="195239698" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/20893" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/20893/hovercard" href="https://github.com/symfony/symfony/issues/20893">#20893</a> issue, theres a problem when you change to <code class="notranslate">prod</code> environment, all the routes annotated with <code class="notranslate">@Method("HEAD")</code> are not accessible, because before to send it to backend, is sent a <code class="notranslate">GET</code> instead of a <code class="notranslate">HEAD</code> and that route is not configured for this method.</p>
<p dir="auto">The only solution is to annotate it as <code class="notranslate">@Method({"HEAD", "GET"})</code>.</p>