[wp-trac] [WordPress Trac] #14348: If it's a HEAD request, stop after the head!

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 12 05:29:21 UTC 2012


#14348: If it's a HEAD request, stop after the head!
---------------------------------------------+------------------
 Reporter:  mitchoyoshitaka                  |       Owner:
     Type:  enhancement                      |      Status:  new
 Priority:  normal                           |   Milestone:  3.5
Component:  Performance                      |     Version:  3.0
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch 3.5-early 2nd-opinion  |
---------------------------------------------+------------------

Comment (by mitchoyoshitaka):

 Replying to [comment:39 mitchoyoshitaka]:
 > I don't think the action `head_request` and triggering it in the tests
 is the best way to test this. Why not simply set
 `$_SERVER['REQUEST_METHOD'] = 'HEAD'` and check that it ends with no
 input?

 Sorry, nevermind. That is essentially what you're doing. I spoke too
 early.

 Is wrapping this code in an action in order to check just its behavior
 necessary for the test? This isn't a realistic test for checking that no
 output is printed, then, as it doesn't actually run all the code that
 would happen in a normal request before getting to the `head_request`
 point. Or maybe I'm missing something?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14348#comment:40>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list