1
0
Эх сурвалжийг харах

Set content-type before sending image data for a valid response

JoKneeMo 2 жил өмнө
parent
commit
82d64bff96
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      results/index.php

+ 1 - 1
results/index.php

@@ -212,7 +212,6 @@ function drawImage($speedtest)
     imagefttext($im, $FONT_WATERMARK_SIZE, 0, $POSITION_X_WATERMARK, $POSITION_Y_WATERMARK, $TEXT_COLOR_WATERMARK, $FONT_WATERMARK, $WATERMARK_TEXT);
 
     // send the image to the browser
-    header('Content-Type: image/png');
     imagepng($im);
 }
 
@@ -221,4 +220,5 @@ if (!is_array($speedtest)) {
     exit(1);
 }
 
+header('Content-Type: image/png');
 drawImage($speedtest);