[Updated] D8935: hgweb: ignore web.templates config when guessing mime type for static content

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat Aug 22 23:32:15 UTC 2020


Closed by commit rHGec2fc4d038c2: hgweb: ignore web.templates config when guessing mime type for static content (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8935?vs=22414&id=22420

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8935/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8935

AFFECTED FILES
  mercurial/hgweb/common.py

CHANGE DETAILS

diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py
--- a/mercurial/hgweb/common.py
+++ b/mercurial/hgweb/common.py
@@ -201,7 +201,7 @@
     try:
         os.stat(path)
         ct = pycompat.sysbytes(
-            mimetypes.guess_type(pycompat.fsdecode(path))[0] or r"text/plain"
+            mimetypes.guess_type(pycompat.fsdecode(fpath))[0] or r"text/plain"
         )
         with open(path, b'rb') as fh:
             data = fh.read()



To: martinvonz, #hg-reviewers, indygreg
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200822/8bc316ce/attachment-0002.html>


More information about the Mercurial-patches mailing list