Skip to content

Commit 1faaf32

Browse files
committed
Skip sending Content-Type header if headers already sent
1 parent a76c500 commit 1faaf32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

includes/class-amp-theme-support.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,9 @@ public static function prepare_response( $response, $args = [] ) {
20542054
}
20552055

20562056
// Enforce UTF-8 encoding as it is a requirement for AMP.
2057-
header( 'Content-Type: text/html; charset=utf-8' );
2057+
if ( ! headers_sent() ) {
2058+
header( 'Content-Type: text/html; charset=utf-8' );
2059+
}
20582060

20592061
/**
20602062
* Filters whether response (post-processor) caching is enabled.

0 commit comments

Comments
 (0)