<?php
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    http_response_code(200);
    echo true;
}

chdir(__DIR__);

require_once('config.php');
$domain = parse_url(HTTPS_SERVER);
$host = $domain['host'];
putenv('SERVER_NAME='.$host);
$_SERVER['SERVER_NAME'] = $host;

if (!empty($argv)) {
    array_shift($argv);
    parse_str(implode('&', $argv), $_POST);
}

$_GET['route'] = 'extension/shipping/inpost_shipping';
$_POST['inpostHookData'] = file_get_contents("php://input");

require_once('index.php');