mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 19:03:30 -05:00
Remove redundant 413 error page
This was used when there was an Nginx instance sitting in front of
Admin [1], but nowadays traffic goes through CloudFront, where we
decided not to implement the same protection:
- The likelihood of large requests being a security threat is small
because it's a difficult attack vector.
- We have put in place specific limits on routes where we the size
of the request is actually important [2].
Note that the other error pages can all still be used based on the
response code we get from API requests [3]. Also worth noting we've
had 0 413 response codes for Admin in the last month.
[1]: https://github.com/alphagov/notifications-aws/blob/master/ansible/roles/nginx/templates/nginx.conf.j2#L29-L30
[2]: https://github.com/alphagov/notifications-admin/pull/4090
[3]: b3c0abc496/app/__init__.py (L407-L416)
This commit is contained in:
@@ -426,10 +426,6 @@ def register_errorhandlers(application): # noqa (C901 too complex)
|
||||
def handle_gone(error):
|
||||
return _error_response(410)
|
||||
|
||||
@application.errorhandler(413)
|
||||
def handle_payload_too_large(error):
|
||||
return _error_response(413)
|
||||
|
||||
@application.errorhandler(404)
|
||||
def handle_not_found(error):
|
||||
return _error_response(404)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% block per_page_title %}File too big{% endblock %}
|
||||
{% block maincolumn_content %}
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-two-thirds">
|
||||
<h1 class="heading-large">
|
||||
The file you uploaded was too big
|
||||
</h1>
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-two-thirds">
|
||||
<p class="govuk-body">
|
||||
Files must be smaller than 5 MB.
|
||||
</p>
|
||||
<p class="govuk-body">
|
||||
<a class="govuk-link govuk-link--no-visited-state" href="javascript: history.go(-1)">Go back and try again.</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user