Skip to content

Commit 7a530db

Browse files
authored
Merge pull request #200 from rtCamp/fix/content-type-validation
Fix header key comparison
2 parents ec0b566 + 99abe90 commit 7a530db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

admin/class-nginx-helper-admin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,11 @@ public function add_timestamps() {
427427

428428
foreach ( headers_list() as $header ) {
429429
list( $key, $value ) = explode( ':', $header, 2 );
430-
if ( 'Content-Type' === $key && strpos( trim( $value ), 'text/html' ) !== 0 ) {
430+
$key = strtolower( $key );
431+
if ( 'content-type' === $key && strpos( trim( $value ), 'text/html' ) !== 0 ) {
431432
return;
432433
}
433-
if ( 'Content-Type' === $key ) {
434+
if ( 'content-type' === $key ) {
434435
break;
435436
}
436437
}

0 commit comments

Comments
 (0)