Skip to content

Commit

Permalink
new Cloudflare requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
dalacost committed Mar 29, 2024
1 parent 2ecf342 commit bf68a27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/thingiverse.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public static function get_authorization_token(){
//Returns a Json object
public static function get_authorized_url_json($url){

$authorization_header = 'Authorization: Bearer '.Thingiverse::get_authorization_token();
$authorization_header = array(
'Authorization: Bearer '.Thingiverse::get_authorization_token(),
'Referer: '.Thingiverse::BASE_URL
);
$options = ['http' => ['header' => $authorization_header]];
$context = stream_context_create($options);
$json = file_get_contents($url, false, $context);
Expand Down

0 comments on commit bf68a27

Please sign in to comment.