File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed
Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -293,17 +293,11 @@ public static function use_custom_user_expiration( $expiration ) {
293293 */
294294 public static function add_tokens_to_graphql_response_headers ( $ headers ) {
295295
296- $ should_return_tokens = false ;
297-
298296 /**
299297 * If the request _is_ SSL, or GRAPHQL_DEBUG is defined, return the tokens
300298 * otherwise do not return them.
301299 */
302- if ( is_ssl () || defined ( 'GRAPHQL_DEBUG ' ) && true !== GRAPHQL_DEBUG ) {
303- $ should_return_tokens = true ;
304- }
305-
306- if ( ! $ should_return_tokens ) {
300+ if ( ! is_ssl () && ( ! defined ( 'GRAPHQL_DEBUG ' ) || true !== GRAPHQL_DEBUG ) ) {
307301 return $ headers ;
308302 }
309303
@@ -358,17 +352,11 @@ public static function add_tokens_to_graphql_response_headers( $headers ) {
358352 */
359353 public static function add_auth_headers_to_rest_response ( \WP_HTTP_Response $ response , $ handler , $ request ) {
360354
361- $ should_return_tokens = false ;
362-
363355 /**
364356 * If the request _is_ SSL, or GRAPHQL_DEBUG is defined, return the tokens
365357 * otherwise do not return them.
366358 */
367- if ( is_ssl () || defined ( 'GRAPHQL_DEBUG ' ) && true !== GRAPHQL_DEBUG ) {
368- $ should_return_tokens = true ;
369- }
370-
371- if ( ! $ should_return_tokens ) {
359+ if ( ! is_ssl () && ( ! defined ( 'GRAPHQL_DEBUG ' ) || true !== GRAPHQL_DEBUG ) ) {
372360 return $ response ;
373361 }
374362
You can’t perform that action at this time.
0 commit comments