• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Contributions (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Proxy content type

Post a bug fix, a new feature, a theme ...

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
2 posts • Page 1 of 1

Postby bcc » Tue Oct 17, 2006 2:15 am

Code: Select all
Index: src/client/proxy.php.tpl
===================================================================
--- src/client/proxy.php.tpl    (revision 1893)
+++ src/client/proxy.php.tpl    (working copy)
@@ -35,6 +35,10 @@
   $contenttype = "text/javascript";
 else if (preg_match("/.css$/", $file))
   $contenttype = "text/css";
+else if (preg_match("/.gif$/", $file))
+  $contenttype = "image/gif";
+else if (preg_match("/.jpg$/", $file))
+  $contenttype = "image/jpeg";
 header("Content-Length: ".$contentlength);
 header("Content-Type: ".$contenttype);
 session_cache_limiter('public');

This seems like the right thing.
Also, I think it should be ".xxx$" not ".xxx$", but I didn't change it.
bcc
Member
 
Posts: 54
Joined: Wed Mar 08, 2006 4:09 am
Top

Postby phpfreechat » Tue Oct 17, 2006 8:45 am

Thank you for your help.
I just modified the file like that :
Code: Select all
Index: proxy.php.tpl
===================================================================
--- proxy.php.tpl       (révision 833)
+++ proxy.php.tpl       (copie de travail)
@@ -44,10 +44,18 @@
 // output HTTP headers
 $contenttype   = "text/plain";
 //$contentlength = filesize($file);
-if (preg_match("/.js$/", $file))
+if (preg_match("/.js$/", $file))
   $contenttype = "text/javascript";
-else if (preg_match("/.css$/", $file))
+else if (preg_match("/.css$/", $file))
   $contenttype = "text/css";
+else if (preg_match("/.gif$/", $file))
+  $contenttype = "image/gif";
+else if (preg_match("/.jpg$/", $file))
+  $contenttype = "image/jpeg";
+else if (preg_match("/.jpeg$/", $file))
+  $contenttype = "image/jpeg";
+else if (preg_match("/.png$/", $file))
+  $contenttype = "image/png";
 header("Content-Type: ".$contenttype);
 $contentlength = ob_get_length();
 header("Content-Length: ".$contentlength);
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
2 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 13 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub