Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code scanning alert no. 24: Jinja2 templating with autoescape=False #341

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading