From 8deb4def42f8a9bd3c5201d30272a6d960dd9962 Mon Sep 17 00:00:00 2001 From: jasonbahl Date: Tue, 13 Jun 2017 15:27:12 -0600 Subject: [PATCH] #1 - Adjusts headers to include a User-Agent --- readme.txt | 2 +- wp-graphql-dad-jokes.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 83b27d7..8ea6605 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://wpgraphql.com/ Tags: wpgraphql, graphql, api, dad jokes Requires at least: 4.4 Tested up to: 4.7.5 -Stable tag: 0.1.0 +Stable tag: 0.1.01 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html diff --git a/wp-graphql-dad-jokes.php b/wp-graphql-dad-jokes.php index 3cb772b..59e18c2 100644 --- a/wp-graphql-dad-jokes.php +++ b/wp-graphql-dad-jokes.php @@ -7,9 +7,9 @@ * Author URI: http://graphql.com * Text Domain: wp-graphql-dad-jokes * Domain Path: /languages - * Version: 0.1.0 + * Version: 0.1.01 * - * @package Wp_Graphql_Dad_Jokes + * @package WP_Graphql_Dad_Jokes */ if ( ! defined( 'ABSPATH' ) ) { exit; @@ -26,6 +26,7 @@ function wp_graphql_dad_jokes_root_query( $fields ) { $get_dad_joke = wp_remote_get('https://icanhazdadjoke.com/', [ 'headers' => [ 'Accept' => 'application/json', + 'User-Agent' => esc_html( get_bloginfo( 'name' ) ), ], ] ); $body = ! empty( $get_dad_joke['body'] ) ? json_decode( $get_dad_joke['body'] ) : null;