We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5756f29 commit d645a31Copy full SHA for d645a31
inspector/main.py
@@ -64,6 +64,9 @@ def versions(project_name):
64
resp = requests.get(f"https://pypi.org/pypi/{project_name}/json")
65
pypi_project_url = f"https://pypi.org/project/{project_name}"
66
67
+ # Self-host 404 page to mitigate iframe embeds
68
+ if resp.status_code == 404:
69
+ return render_template("404.html")
70
if resp.status_code != 200:
71
return redirect(pypi_project_url, 307)
72
inspector/templates/404.html
@@ -0,0 +1,5 @@
1
+{% extends 'base.html' %}
2
+
3
+{% block body %}
4
+<h1>NOT FOUND</h1>
5
+{% endblock %}
0 commit comments