mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-05-14 14:02:51 +00:00
feat: adhere to image loading preference
This commit is contained in:
parent
10946dcafb
commit
fb7dc85905
2 changed files with 14 additions and 7 deletions
|
@ -141,13 +141,20 @@ func ViewQuestion(c *gin.Context) {
|
|||
answers = append(answers, template.HTML(answerBodyHTML))
|
||||
})
|
||||
|
||||
imagePolicy := "https:"
|
||||
|
||||
if c.MustGet("disable_images").(bool) {
|
||||
imagePolicy = "'none'"
|
||||
}
|
||||
|
||||
c.HTML(200, "question.html", gin.H{
|
||||
"title": questionText,
|
||||
"body": template.HTML(questionBodyParentHTML),
|
||||
"timestamp": questionTimestamp,
|
||||
"author": questionAuthor,
|
||||
"authorURL": questionAuthorURL,
|
||||
"answers": answers,
|
||||
"title": questionText,
|
||||
"body": template.HTML(questionBodyParentHTML),
|
||||
"timestamp": questionTimestamp,
|
||||
"author": questionAuthor,
|
||||
"authorURL": questionAuthorURL,
|
||||
"answers": answers,
|
||||
"imagePolicy": imagePolicy,
|
||||
})
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue