Skip to content

Commit

Permalink
Merge pull request #7 from privacybydesign/fix/startscript
Browse files Browse the repository at this point in the history
update file_get_contents to work with http
  • Loading branch information
w-ensink authored Nov 18, 2024
2 parents 07d702b + 30d2d5b commit 99644a6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions start_session.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require_once 'config.php';

date_default_timezone_set('UTC');
$protocol = explode(':', IRMA_SERVER_URL, 2)[0];

$sprequests = [
'18plus' => [
Expand Down Expand Up @@ -44,7 +43,7 @@
];

function start_session($type) {
global $sprequests, $protocol;
global $sprequests;

if (array_key_exists($type, $sprequests))
$sessionrequest = $sprequests[$type];
Expand All @@ -54,12 +53,12 @@ function start_session($type) {
$jsonsr = json_encode($sessionrequest);

$api_call = array(
$protocol => array(
'http' => array(
'method' => 'POST',
'header' => "Content-type: application/json\r\n"
. "Content-Length: " . strlen($jsonsr) . "\r\n"
. (!empty(API_TOKEN) ? "Authorization: " . API_TOKEN . "\r\n" : ""),
'content' => $jsonsr
. "Content-Length: " . strlen($jsonsr) . "\r\n"
. "Authorization: " . API_TOKEN . "\r\n",
'content' => $jsonsr,
)
);

Expand Down

0 comments on commit 99644a6

Please sign in to comment.