Skip to content

Commit

Permalink
Swap 403 error messaging for legibility (#76)
Browse files Browse the repository at this point in the history
* Swap 403 error messaging for legibility

* Prioritize human-readable errors in all error templates

* Revert changes to error code numbers

* Revert change to 500.html

* Revert 404 string

---------

Co-authored-by: Claire Goeckner-Wald <4743638-cgoecknerwald@users.noreply.gitlab.com>
Co-authored-by: Kevin Chung <kchung@ctfd.io>
  • Loading branch information
3 people authored Apr 9, 2024
1 parent ba1b29c commit 79cb6e5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions templates/errors/403.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
<div class="row">
<div class="col-md-12">
<div class="pt-5 mt-5 text-center">
<h1>{% trans %}Forbidden{% endtrans %}</h1>
<h1>{{ error }}</h1>
<hr class="w-50 m-auto">
<h2>{{ error }}</h2>
<br/>
<h2>{% trans %}403 Forbidden{% endtrans %}</h2>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions templates/errors/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<div class="row">
<div class="col-md-12">
<div class="pt-5 mt-5 text-center">
<h1>404</h1>
<h1>{% trans %}File not found{% endtrans %}</h1>
<hr class="w-50 m-auto">
<h2>{% trans %}File not found{% endtrans %}</h2>
<h2>{% trans %}Sorry about that{% endtrans %}</h2>
<br/>
<h2>{% trans %}404 Not Found{% endtrans %}</h2>
</div>
</div>
</div>
Expand Down
7 changes: 4 additions & 3 deletions templates/errors/429.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
<div class="row">
<div class="col-md-12">
<div class="pt-5 mt-5 text-center">
<h1>429</h1>
<h1>{% trans %}Too many requests{% endtrans %}</h1>
<h1>{% trans %}Please slow down!{% endtrans %}</h1>
<hr class="w-50 m-auto">
<h2>{% trans %}Too many requests{% endtrans %}</h2>
<h2>{% trans %}Please slow down!{% endtrans %}</h2>
<br/>
<h2>{% trans %}429 Too Many Requests{% endtrans %}</h2>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions templates/errors/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<div class="pt-5 mt-5 text-center">
<h1>500</h1>
<hr class="w-50 m-auto">
<br/>
<h2>{{ error }}</h2>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion templates/errors/502.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<div class="pt-5 mt-5 text-center">
<h1>502</h1>
<hr class="w-50 m-auto">
<h2>{% trans %}Bad Gateway{% endtrans %}</h2>
<br/>
<h2>{% trans %}502 Bad Gateway{% endtrans %}</h2>
</div>
</div>
</div>
Expand Down

0 comments on commit 79cb6e5

Please sign in to comment.