middleware for displaying 413 page
When a RequestDataTooBig exception is thrown, users are largely in the dark about what happened and how it can be fixed. This commit resolves this by inserting middleware to redirect the request to a custom 413 error page. This exception is thrown when DATA_UPLOAD_MAX_MEMORY_SIZE is exceeded. The default value is 2.5MB. Fixes #2340 Fixes #2633
This commit is contained in:
parent
06568aab88
commit
a7fcd898c2
4 changed files with 48 additions and 0 deletions
16
bookwyrm/templates/413.html
Normal file
16
bookwyrm/templates/413.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "File too large" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
<h1 class="title">{% trans "File too large" %}</h1>
|
||||
<p class="content">{% trans "The file you are uploading is too large." %}</p>
|
||||
<p class="content">
|
||||
{% blocktrans %}
|
||||
You you can try using a smaller file, or ask your BookWyrm server administrator to increase the <code>DATA_UPLOAD_MAX_MEMORY_SIZE</code> setting.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue