Index: wp-includes/class-wp.php
===================================================================
--- wp-includes/class-wp.php	(revision 21959)
+++ wp-includes/class-wp.php	(working copy)
@@ -505,6 +505,9 @@
 			}
 		}
 
+		// Let plugins hook in and possibly abort the 404
+		do_action( 'pre_send_404_header' );
+
 		// Guess it's time to 404.
 		$wp_query->set_404();
 		status_header( 404 );
