Fossil

Check-in [4172bcdcea]
Login

Check-in [4172bcdcea]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove a redundant comment from the previous checkin. No code changes.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4172bcdcea02050c867338d46e0dc9d14667a88d76574be694da8f2d8e122d3a
User & Date: stephan 2024-08-03 19:54:37.533
Context
2024-08-05
15:10
Replace the JavaScript-based side-by-side diff view with a CSS Grid, as discussed in [forum:93398561d3986c41|forum post 93398561d3986c41]. ... (check-in: 71e9ca7869 user: stephan tags: trunk)
2024-08-03
19:54
Remove a redundant comment from the previous checkin. No code changes. ... (check-in: 4172bcdcea user: stephan tags: trunk)
19:49
/chat: when downloading a file via chat which has a text/... mimetype but it looks_like_binary(), change the mimetype to application/octet-stream. See code comments for the motivation behind this. ... (check-in: 87edfb0a48 user: stephan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/chat.c.
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
  if( bCheckedMimetype==0 && sqlite3_strglob("text/*", zMime)==0 ){
    /* The problem: both Chrome and Firefox upload *.patch with
    ** the mimetype text/x-patch, whereas we very often use that
    ** name glob for fossil-format patches. That causes such files
    ** to attempt to render in the browser when clicked via
    ** download links in chat.
    **
    ** The workaround: if a text/... file is looks_like_binary()
    ** then change the mimetype to application/octet-stream.
    */
    if( looks_like_binary(&r) ){
      zMime = "application/octet-stream";
    }
  }
  cgi_set_content_type(zMime);
  cgi_set_content(&r);
}







|
<
<







1003
1004
1005
1006
1007
1008
1009
1010


1011
1012
1013
1014
1015
1016
1017
  if( bCheckedMimetype==0 && sqlite3_strglob("text/*", zMime)==0 ){
    /* The problem: both Chrome and Firefox upload *.patch with
    ** the mimetype text/x-patch, whereas we very often use that
    ** name glob for fossil-format patches. That causes such files
    ** to attempt to render in the browser when clicked via
    ** download links in chat.
    **
    ** The workaround: */


    if( looks_like_binary(&r) ){
      zMime = "application/octet-stream";
    }
  }
  cgi_set_content_type(zMime);
  cgi_set_content(&r);
}