This commit is contained in:
split / May 2023-02-07 20:08:33 -08:00
parent 2516643561
commit 306d642806
2 changed files with 3 additions and 0 deletions

View file

@ -6,6 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>monofile</title> <title>monofile</title>
$metaTags
<meta name="og:site_name" content="monofile $Version"> <meta name="og:site_name" content="monofile $Version">
<meta name="title" content="$FileName"> <meta name="title" content="$FileName">
<meta name="description" content="ID: $FileId"> <meta name="description" content="ID: $FileId">

View file

@ -118,6 +118,7 @@ app.get("/download/:fileId",(req,res) => {
.replace(/\</g,"&lt;") .replace(/\</g,"&lt;")
.replace(/\>/g,"&gt;") .replace(/\>/g,"&gt;")
) )
.replace(/\$metaTags/g,file.mime.startsWith("image/") ? `<meta name="og:image" content="https://${req.headers.host}/file/${req.params.fileId}" />` : "")
) )
}) })
} else { } else {