Module: tools Branch: master Commit: 6dde8de8257a1333a8951a0e6cd11f5f41e01d80 URL: https://source.winehq.org/git/tools.git/?a=commit;h=6dde8de8257a1333a8951a0e...
Author: Francois Gouget fgouget@codeweavers.com Date: Tue Jun 26 13:40:47 2018 +0200
testbot/web: Adjust the GetFile MIME type based on Step->FileType.
This lets the browser offer to open the patches in a text editor instead of systematically suggesting to save them to disk.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/web/GetFile.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/testbot/web/GetFile.pl b/testbot/web/GetFile.pl index 7e274a8..1fe1407 100644 --- a/testbot/web/GetFile.pl +++ b/testbot/web/GetFile.pl @@ -84,9 +84,11 @@ sub GetFile($$$)
# HTTP/1.0 $Request->headers_out->add("Pragma", "no-cache"); - - # Binary file - $Request->content_type("application/octet-stream"); + + # Text or binary file + my $MIME = $Step->FileType eq "patchdlls" ? "text/plain" : + "application/octet-stream"; + $Request->content_type($MIME); $Request->headers_out->add("Content-Disposition", 'attachment; filename="' . $Step->FileName . '"');