Hi,
I was trying to adapt the template loading and embedding logic for my Echo-based project when I noticed this part here:
|
lay := e.Templates.Lookup(layout[0]) |
I expected to see lay.Clone() being called here, because the current solution attaches the embed func globally. This could be a potential security threat, if someone ends up rendering main.html by mistake.
Checking the history, I saw that there was a version that cloned the template, but it was replaced, because a cloned template cannot be executed multiple times. But if you are always only executing the copy, why would the original template get executed in the first place?
I would love to hear your thoughts.