Index: src/wp-includes/rest-api/class-wp-rest-server.php
===================================================================
--- src/wp-includes/rest-api/class-wp-rest-server.php	(revision 45248)
+++ src/wp-includes/rest-api/class-wp-rest-server.php	(working copy)
@@ -1266,6 +1266,15 @@
 	 * @param array $headers Map of header name to header value.
 	 */
 	public function send_headers( $headers ) {
+		/**
+		 * Filters the HTTP headers before they're sent to the browser for a REST request.
+		 *
+		 * @since 5.2.0
+		 *
+		 * @param string[] $headers Associative array of headers to be sent.
+		 */
+		$headers = apply_filters( 'wp_rest_headers', $headers );
+
 		foreach ( $headers as $key => $value ) {
 			$this->send_header( $key, $value );
 		}
