Skip to content

Commit

Permalink
Fix code scanning alert no. 24: Jinja2 templating with autoescape=False
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent ad5a2b1 commit 6748c44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pds/registry/utils/geostac/create_lola_pds4.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pathlib import Path

import requests
from jinja2 import Environment
from jinja2 import Environment, select_autoescape
from pds.registry.utils.geostac import templates

logging.basicConfig(level=logging.INFO)
Expand Down Expand Up @@ -85,7 +85,7 @@ def create_product_external(item):
:return: pds4 xml
"""
# create env
env = Environment()
env = Environment(autoescape=select_autoescape(['html', 'xml']))
with importlib.resources.open_text(templates, "product-external-template.xml") as io:
template_text = io.read()
template = env.from_string(template_text)
Expand Down Expand Up @@ -143,7 +143,7 @@ def create_product_browse(item):
:return: pds4 xml
"""
# create env
env = Environment()
env = Environment(autoescape=select_autoescape(['html', 'xml']))

with importlib.resources.open_text(templates, "product-browse-template.xml") as io:
template_text = io.read()
Expand Down

0 comments on commit 6748c44

Please sign in to comment.