From 54da426874635d477eef8529d219bf425e24ba37 Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Fri, 2 Dec 2022 16:26:55 +0000 Subject: [PATCH] Remove redirect (#8) Resolve #5 Co-authored-by: Tyler Perkins Reviewed-on: https://git.clortox.com/tyler/site/pulls/8 --- src/resume.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/resume.php b/src/resume.php index 7b7d52a..5ae086f 100644 --- a/src/resume.php +++ b/src/resume.php @@ -10,18 +10,28 @@ if(!$result){ die(); } +curl_close($curl); $parsed = json_decode($result, true); -//var_dump($parsed[0]); - $url = $parsed[0]["assets"][0]["browser_download_url"]; if(!$url){ header('HTTP/1.1 500 Internal Server Error'); die(); } -header('Location: ' . $url); +header('Content-Description: File Transfer'); +header('Content-Type: application/pdf; charset=UTF-8'); +header('Content-Disposition: inline;filename=Tyler-Perkins-Resume.pdf'); +header('Expires: 0'); +$result = file_get_contents($url); + +if(!$result){ + header('HTTP/1.1 500 Internal Server Error'); + die(); +} + +echo $result; die(); ?>