]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commit
logo.cgi: Fix for bug13795 - captive portal not displaying uploaded logo
authorAdolf Belka <adolf.belka@ipfire.org>
Thu, 9 Jan 2025 19:04:35 +0000 (20:04 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Fri, 24 Jan 2025 08:55:38 +0000 (09:55 +0100)
commit36391d1d0d2dfb69077e2d860d2af3c975cf86f6
treede76cacd14817b33a7ff481c2c20c048ca981265
parent55b13b3b94713ab800bf28d919cd2b2b036f3f31
logo.cgi: Fix for bug13795 - captive portal not displaying uploaded logo

- This v2 version now includes the use of File-LibMagic to identify the specific
   content type and apply that to the modified header command so that image/png or
   image/jp[eg are used depending on the type of image provided.
- Something changed in some package in CU188 that means that the existing method of
   printing the content type to the browser no longer worked.
- I tested it in some stand alone code and even if using text/txt for the content-type
   print statement the File::Copy::copy then resulted in an Internal Server Error with
   the same message as with the image file which was "malformed header from script
   'logo.cgi': Bad header:".
- I tested it with text, html, image and application. In all cases the error message
   about a bad header was provided.
- Did some searching and found an alternative way to explicitly print the header info
   which is what I have used in this patch change.
- With this approach, in the stand alone code, I was able to get an image, html code or
   text shown in the browser correctly and without any error message.
- I then used this new method in the logo.cgi code as submitted here and tested the
   change in my vm testbed and the image was shown in the captive portal correctly.
- So this change fixes the problem with the logo not being shown but I have been unable
   to identify what changed to stop the method that worked prior to CU188 from working
   any more.

Fixes: Bug13795
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
html/cgi-bin/captive/logo.cgi