From e67fa24d3c21792b3adab3f88e2383219018b696 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 13 Mar 2012 15:25:25 +0000 Subject: o Initial import. --- endpoint.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 endpoint.php (limited to 'endpoint.php') diff --git a/endpoint.php b/endpoint.php new file mode 100644 index 0000000..e133c90 --- /dev/null +++ b/endpoint.php @@ -0,0 +1,36 @@ + $value) { + if(strpos($key, "HTTP_") === 0) { + $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($key, 5))))); + fwrite($fd, $key . ": ". $value . "\n"); + } +} +$content_type = $_SERVER["CONTENT_TYPE"]; +if(isset($content_type)) { + fwrite($fd, "Content-Type: ". $content_type . "\n"); +} + +$content_length = $_SERVER["CONTENT_LENGTH"]; +if(isset($content_length)) { + fwrite($fd, "Content-Length: ". $content_length . "\n"); +} +fwrite($fd, "\n"); +fflush($fd); +fclose($fd); + +header("HTTP/1.1 200 Stored message for endpoint '" . $id . "'."); +?> -- cgit v1.2.3