Browse Source

Merge pull request 'Added Content-Type to proxied images and audio' (#6) from ManeraKai/Tent:main into main

Reviewed-on: https://codeberg.org/sun/Tent/pulls/6
Sunny 2 years ago
parent
commit
ac4fd24962
2 changed files with 4 additions and 3 deletions
  1. 2 1
      pages/audio.php
  2. 2 2
      pages/image.php

+ 2 - 1
pages/audio.php

@@ -6,6 +6,7 @@
     return strlen($data);
   });
 
-  header("Content-Type: application/octet-stream");
+  $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
+  header("Content-Type: $contentType");
   curl_exec($ch);
 ?>

+ 2 - 2
pages/image.php

@@ -17,8 +17,8 @@
         echo $data;
         return strlen($data);
       });
-
-      header("Content-Type: application/octet-stream");
+      $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
+      header("Content-Type: $contentType");
       curl_exec($ch);
 
       break;