Skip to content

Commit

Permalink
c2.php, ref #138
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Oct 25, 2022
1 parent 2e6544f commit 5cb2974
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions re-signing-gateway/c2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
require_once("./lib/PonderSource/AS4.php");
if ($_SERVER["REQUEST_METHOD"] == 'POST') {
error_log("Hi");
$as4 = new \OCA\PeppolNext\PonderSource\AS4();
$contentType = "unknown";
$headers = apache_request_headers();
foreach ($headers as $header => $value) {
if (strtolower($header) == "content-type") {
$contentType = $value;
}
error_log("[INCOMING HEADER] $header: $value");
}
error_log("[CONTENT-TYPE] $contentType");
$body = file_get_contents('php://input');
error_log("[REQUEST BODY LENGTH] " . strlen($body));
$response = $as4->handleAs4($contentType, $body);
error_log("[RESPONSE BODY LENGTH] " . strlen($response));
header('Referrer-Policy: strict-origin-when-cross-origin');
header('X-Frame-Options: SAMEORIGIN');
header('X-Content-Type-Options: nosniff');
header('X-XSS-Protection: 1; mode=block');
header('Strict-Transport-Security: max-age=3600;includeSubDomains');
header('Cache-Control: no-cache, no-store, must-revalidate, proxy-revalidate');
header('Content-Type: application/soap+xml;charset=utf-8');
header('Content-Disposition:');
echo $response;
}

0 comments on commit 5cb2974

Please sign in to comment.