Skip to content

Commit 9f191a6

Browse files
committed
small fixes
1 parent cac5535 commit 9f191a6

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

app/templates/view_validators.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,18 @@ <h2>Validation Results</h2>
5353
{% if not data.record_errors %}
5454
<p>No validation errors found</p>
5555
{% else %}
56-
<div class="usa-table-container" tabindex="0">
57-
<div class="error-list">
58-
{% for record_error in data.record_errors %}
59-
<div class="error-block">
60-
<p style="word-break: break-all"><strong>Identifier:</strong> {{ record_error[0] ~ " (dataset position)" if record_error[0] is number else record_error[0] }}</p>
61-
<p>
62-
<strong>Error Message:</strong>
63-
<ul>
64-
<li>{{ record_error[1] }}</li>
65-
</ul>
66-
</p>
67-
</div>
68-
{% endfor %}
56+
<div class="error-list">
57+
{% for record_error in data.record_errors %}
58+
<div class="error-block">
59+
<p style="word-break: break-all"><strong>Identifier:</strong> {{ record_error[0] ~ " (dataset position)" if record_error[0] is number else record_error[0] }}</p>
60+
<p>
61+
<strong>Error Message:</strong>
62+
<ul>
63+
<li>{{ record_error[1] }}</li>
64+
</ul>
65+
</p>
6966
</div>
67+
{% endfor %}
7068
</div>
7169
{% endif %}
7270
{% endif %}
@@ -76,7 +74,7 @@ <h2>Validation Results</h2>
7674

7775
{% block scripts %}
7876

79-
<script>
77+
<script nonce="{{ csp_nonce() }}">
8078
function toggleInputFields() {
8179
const method = document.getElementById("fetch_method").value;
8280

app/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def is_public_ip(hostname: str) -> bool:
9999

100100
def fetch_json_from_url(url: str) -> dict:
101101

102-
MAX_CONTENT_LENGTH = 10 * 1024 * 1024 # 10MB limit
102+
max_content_length = 10 * 1024 * 1024 # 10MB limit
103103

104104
parsed = urlparse(url)
105105

@@ -123,8 +123,8 @@ def fetch_json_from_url(url: str) -> dict:
123123
if "application/json" not in content_type:
124124
raise ValueError("URL did not return JSON.")
125125

126-
content = response.raw.read(MAX_CONTENT_LENGTH + 1)
127-
if len(content) > MAX_CONTENT_LENGTH:
126+
content = response.raw.read(max_content_length + 1)
127+
if len(content) > max_content_length:
128128
raise ValueError("JSON payload too large.")
129129

130130
return response.json()

0 commit comments

Comments
 (0)