diff options
Diffstat (limited to '')
| -rw-r--r-- | api/guestbook-proxy.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/api/guestbook-proxy.php b/api/guestbook-proxy.php new file mode 100644 index 0000000..63f1446 --- /dev/null +++ b/api/guestbook-proxy.php @@ -0,0 +1,29 @@ +<?php +// Proxy for guestbook comments — sidesteps browser CORS restrictions. +// PHP fetches happen server-to-server with no CORS enforcement. + +header('Content-Type: text/html; charset=utf-8'); +header('Cache-Control: no-store, no-cache'); +header('X-Robots-Tag: noindex'); + +$url = 'https://guestbook.sillylaird.ca/guestbook-comments.php'; +$ctx = stream_context_create([ + 'http' => [ + 'timeout' => 8, + 'user_agent' => 'SillyLaird-Proxy/1.0', + 'ignore_errors' => true, + ], + 'ssl' => [ + 'verify_peer' => true, + 'verify_peer_name' => true, + ], +]); + +$html = @file_get_contents($url, false, $ctx); + +if ($html === false) { + http_response_code(502); + exit; +} + +echo $html; |
