mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-19 06:07:40 +00:00
fix(developer/ide): model debugger mime type mismatch
Fixes #2630. The MIME type for .js was being read from the registry, which on some systems has been corrupted to text/plain, which causes Chrome to abort loading the script. The fix is to avoid loading the system registered MIME types, which we don't need anyway, because all the MIME types we are using are in the default hard-coded list.
This commit is contained in:
parent
c3cff2f24d
commit
a0001a7caa
2 changed files with 11 additions and 2 deletions
|
|
@ -58,7 +58,11 @@ begin
|
|||
Exit;
|
||||
end;
|
||||
|
||||
AResponseInfo.ContentType := AResponseInfo.HTTPServer.MIMETable.GetFileMIMEType(AFileName);
|
||||
if AResponseInfo.ContentType = '' then
|
||||
begin
|
||||
AResponseInfo.HTTPServer.MIMETable.LoadTypesFromOS := False;
|
||||
AResponseInfo.ContentType := AResponseInfo.HTTPServer.MIMETable.GetFileMIMEType(AFileName);
|
||||
end;
|
||||
AResponseInfo.CharSet := 'UTF-8';
|
||||
AResponseInfo.ContentLength := FileSizeByName(AFileName);
|
||||
//AResponseInfo.LastModified := GetFileDate(doc);
|
||||
|
|
|
|||
|
|
@ -652,6 +652,7 @@ begin
|
|||
Delete(doc, 1, 6);
|
||||
|
||||
// Models always expire immediately
|
||||
AResponseInfo.ContentType := 'application/javascript';
|
||||
AResponseInfo.Expires := EncodeDate(1990, 1, 1); // I4037
|
||||
AResponseInfo.CacheControl := 'no-cache, no-store'; // I4037
|
||||
AResponseInfo.LastModified := Now; // I4037
|
||||
|
|
@ -686,7 +687,11 @@ begin
|
|||
|
||||
// Serve the file
|
||||
|
||||
AResponseInfo.ContentType := AResponseInfo.HTTPServer.MIMETable.GetFileMIMEType(doc);
|
||||
if AResponseInfo.ContentType = '' then
|
||||
begin
|
||||
AResponseInfo.HTTPServer.MIMETable.LoadTypesFromOS := False;
|
||||
AResponseInfo.ContentType := AResponseInfo.HTTPServer.MIMETable.GetFileMIMEType(doc);
|
||||
end;
|
||||
AResponseInfo.CharSet := 'UTF-8';
|
||||
AResponseInfo.ContentLength := FileSizeByName(doc);
|
||||
//AResponseInfo.LastModified := GetFileDate(doc);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue