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 8deb4de commit 7c3bb4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wp-graphql-dad-jokes.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +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' ) ),
'User-Agent' => 'WPGraphQL Dad Jokes (https://github.com/wp-graphql/wp-graphql-dad-jokes)',
],
] );
$body = ! empty( $get_dad_joke['body'] ) ? json_decode( $get_dad_joke['body'] ) : null;
Expand Down

0 comments on commit 7c3bb4f

Please sign in to comment.