Sort status codes, add 504, fix 300 and 404

This commit is contained in:
askiiart 2023-11-09 08:52:22 -06:00
parent aec721db2d
commit f6da1671aa
Signed by untrusted user who does not match committer: askiiart
GPG key ID: BC3800E55FB54D67
7 changed files with 37 additions and 40 deletions

View file

@ -4,7 +4,7 @@ HTTP status codes for nginx, but better.
## Original post
Collection of [@yassie_j@0w0.is](https://0w0.is/yassie_j)'s HTTP response status codes:
Collection of HTTP status codes, from [@yassie_j@0w0.is](https://0w0.is/yassie_j) and a couple others:
- 403 [You Shall Not Pass](https://0w0.is/notice/AZpeq9kdiVbKocpo0m)
- 301 [Your Princess in in Another Castle](https://0w0.is/notice/AZpfAtcGtx1gr4oHVg)
@ -31,10 +31,7 @@ Collection of [@yassie_j@0w0.is](https://0w0.is/yassie_j)'s HTTP response status
- (300 Multiple Choices is the actual error code? Geddit?)
- 404 [You Made A Typo In The URL Didn't You](https://0w0.is/notice/AZpik5MrV9JpId4cTI)
- 423 [Fine Then Keep Your Secrets](https://0w0.is/notice/AZpj18ZUqKTa9u78Pg)
## Additions
- 409 [i'm scared stop asking me q.q](https://meow.woem.cat/notes/9lgiyx2aahggxb4d)
- 429 [i'm scared stop asking me q.q](https://meow.woem.cat/notes/9lgiyx2aahggxb4d)
## nginx rule

View file

@ -2,8 +2,10 @@ import requests
import os
import json
# Replace with a known-404 page for whatever you want. Doing this so the nginx version is accurate.
url_404 = 'https://askiiart.net/sdlfjsadljfs'
html_404 = str(requests.get(url_404).text)
boykisser_url = 'https://askiiart.net/assets/boykisser.png'
try:
os.mkdir('pages')
@ -15,6 +17,15 @@ with open('status-codes.json', 'r') as codes_file:
for code in codes_dict:
new_html = html_404.replace('404 Not Found', f'{code} {codes_dict[code]}')
if code == "404":
new_html = new_html.replace("<h1>404 You Made A Typo In The URL, Didn't You?</h1>",
f"<h1>404 You Made A Typo In The URL, Didn't You?</h1><br><img src={boykisser_url} alt=\"boykisser\" width=\"350\"")
elif code == "300":
# 57% Yes
# - 43% No
# - (300 Multiple Choices is the actual error code? Geddit?)
new_html = new_html.replace(
'<h1>300 Poll</h1>', '<h1>300 Poll</h1><br>57% Yes, 43% No<br>(300 Multiple Choices is the actual error code? Geddit?)')
with open(f'pages/{code}.html', 'w') as new_file:
new_file.write(new_html)

View file

@ -1,7 +1,7 @@
<html>
<head><title>300 Poll</title></head>
<body>
<center><h1>300 Poll</h1></center>
<center><h1>300 Poll</h1><br>57% Yes, 43% No<br>(300 Multiple Choices is the actual error code? Geddit?)</center>
<hr><center>nginx/1.25.3</center>
</body>
</html>

View file

@ -1,7 +1,7 @@
<html>
<head><title>404 You Made A Typo In The URL, Didn't You?</title></head>
<body>
<center><h1>404 You Made A Typo In The URL, Didn't You?</h1></center>
<center><h1>404 You Made A Typo In The URL, Didn't You?</h1><br><img src=https://askiiart.net/assets/boykisser.png alt="boykisser" width="350"</center>
<hr><center>nginx/1.25.3</center>
</body>
</html>

7
pages/504.html Normal file
View file

@ -0,0 +1,7 @@
<html>
<head><title>504 Gateway died on the way back from its home planet</title></head>
<body>
<center><h1>504 Gateway died on the way back from its home planet</h1></center>
<hr><center>nginx/1.25.3</center>
</body>
</html>

View file

@ -1,21 +1,22 @@
{
"403": "You Shall Not Pass",
"301": "Your Princess Is In Another Castle",
"451": "Oi, You Got a Loicense For That Mate?",
"202": "You In My Heart",
"204": "Head Empty No Thoughts",
"300": "Poll",
"301": "Your Princess Is In Another Castle",
"401": "This Is Against TOS You've Been Reported",
"402": "Come Back When You're a Little MMMMMM Richer",
"403": "You Shall Not Pass",
"404": "You Made A Typo In The URL, Didn't You?",
"406": "I Can't Believe You've Done This",
"410": "Your Father",
"413": "Me After a Night With Your Mother",
"417": "Me After 20-something Years With My Mother",
"502": "Forgive Me Father For My Gateway Has Sinned",
"508": "508 508 508 508 508 508 508 508 508 508 508 508 508 508",
"418": "I'm a Teapot",
"410": "Your Father",
"406": "I Can't Believe You've Done This",
"401": "This Is Against TOS You've Been Reported",
"425": "Sorry This Never Happens With Other Women",
"202": "You In My Heart",
"300": "Poll",
"404": "You Made A Typo In The URL, Didn't You?",
"423": "Fine Then, Keep Your Secrets",
"429": "i'm scared stop asking me q.q"
"425": "Sorry This Never Happens With Other Women",
"429": "i'm scared stop asking me q.q",
"451": "Oi, You Got a Loicense For That Mate?",
"502": "Forgive Me Father For My Gateway Has Sinned",
"504": "Gateway died on the way back from its home planet",
"508": "508 508 508 508 508 508 508 508 508 508 508 508 508 508"
}

View file

@ -1,19 +0,0 @@
403;You Shall Not Pass
301;Your Princess Is In Another Castle
451;Oi, You Got a Loicense For That Mate?
204;Head Empty No Thoughts
402;Come Back When You're a Little MMMMMM Richer
413;Me After a Night With Your Mother
417;Me After 20-something Years With My Mother
502;Forgive Me Father For My Gateway Has Sinned
508;508 508 508 508 508 508 508 508 508 508 508 508 508 508
418;I'm a Teapot
410;Your Father
406;I Can't Believe You've Done This
401;This Is Against TOS You've Been Reported
425;Sorry This Never Happens With Other Women
202;You In My Heart
300;Poll
404;You Made A Typo In The URL, Didn't You?
423;Fine Then, Keep Your Secrets
429;i'm scared stop asking me q.q
1 403;You Shall Not Pass
2 301;Your Princess Is In Another Castle
3 451;Oi, You Got a Loicense For That Mate?
4 204;Head Empty No Thoughts
5 402;Come Back When You're a Little MMMMMM Richer
6 413;Me After a Night With Your Mother
7 417;Me After 20-something Years With My Mother
8 502;Forgive Me Father For My Gateway Has Sinned
9 508;508 508 508 508 508 508 508 508 508 508 508 508 508 508
10 418;I'm a Teapot
11 410;Your Father
12 406;I Can't Believe You've Done This
13 401;This Is Against TOS You've Been Reported
14 425;Sorry This Never Happens With Other Women
15 202;You In My Heart
16 300;Poll
17 404;You Made A Typo In The URL, Didn't You?
18 423;Fine Then, Keep Your Secrets
19 429;i'm scared stop asking me q.q