Skip to content

Commit

Permalink
Merge pull request #382 from humanmade/backport-379-to-v10-branch
Browse files Browse the repository at this point in the history
[Backport v10-branch] Forward Authorization to global content repo
  • Loading branch information
roborourke authored Jan 27, 2022
2 parents 452d1d8 + 0ad2271 commit 5930773
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inc/global_content/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,5 +396,11 @@ function filter_global_content_requests_for_auth( array $parsed_args, string $ur
] );
}, $_COOKIE, array_keys( $_COOKIE ) );

// Check for Auth header and forward it, for Basic Auth feature support.
if ( ! isset( $parsed_args['headers']['Authorization'] ) && ! empty( $_SERVER['HTTP_AUTHORIZATION'] ) ) {
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$parsed_args['headers']['Authorization'] = wp_unslash( $_SERVER['HTTP_AUTHORIZATION'] );
}

return $parsed_args;
}

0 comments on commit 5930773

Please sign in to comment.