Skip to content

Commit

Permalink
#1 - Adjusts headers to include a User-Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbahl committed Jun 13, 2017
1 parent d12f5fd commit 8deb4de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions wp-graphql-dad-jokes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 8deb4de

Please sign in to comment.