Sort status codes, add 504, fix 300 and 404
This commit is contained in:
parent
aec721db2d
commit
f6da1671aa
7 changed files with 37 additions and 40 deletions
|
@ -4,7 +4,7 @@ HTTP status codes for nginx, but better.
|
||||||
|
|
||||||
## Original post
|
## 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)
|
- 403 [You Shall Not Pass](https://0w0.is/notice/AZpeq9kdiVbKocpo0m)
|
||||||
- 301 [Your Princess in in Another Castle](https://0w0.is/notice/AZpfAtcGtx1gr4oHVg)
|
- 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?)
|
- (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)
|
- 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)
|
- 423 [Fine Then Keep Your Secrets](https://0w0.is/notice/AZpj18ZUqKTa9u78Pg)
|
||||||
|
- 429 [i'm scared stop asking me q.q](https://meow.woem.cat/notes/9lgiyx2aahggxb4d)
|
||||||
## Additions
|
|
||||||
|
|
||||||
- 409 [i'm scared stop asking me q.q](https://meow.woem.cat/notes/9lgiyx2aahggxb4d)
|
|
||||||
|
|
||||||
## nginx rule
|
## nginx rule
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,10 @@ import requests
|
||||||
import os
|
import os
|
||||||
import json
|
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'
|
url_404 = 'https://askiiart.net/sdlfjsadljfs'
|
||||||
html_404 = str(requests.get(url_404).text)
|
html_404 = str(requests.get(url_404).text)
|
||||||
|
boykisser_url = 'https://askiiart.net/assets/boykisser.png'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.mkdir('pages')
|
os.mkdir('pages')
|
||||||
|
@ -15,8 +17,17 @@ with open('status-codes.json', 'r') as codes_file:
|
||||||
|
|
||||||
for code in codes_dict:
|
for code in codes_dict:
|
||||||
new_html = html_404.replace('404 Not Found', f'{code} {codes_dict[code]}')
|
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:
|
with open(f'pages/{code}.html', 'w') as new_file:
|
||||||
new_file.write(new_html)
|
new_file.write(new_html)
|
||||||
|
|
||||||
|
|
||||||
exit()
|
exit()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<html>
|
<html>
|
||||||
<head><title>300 Poll</title></head>
|
<head><title>300 Poll</title></head>
|
||||||
<body>
|
<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>
|
<hr><center>nginx/1.25.3</center>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<html>
|
<html>
|
||||||
<head><title>404 You Made A Typo In The URL, Didn't You?</title></head>
|
<head><title>404 You Made A Typo In The URL, Didn't You?</title></head>
|
||||||
<body>
|
<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>
|
<hr><center>nginx/1.25.3</center>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
7
pages/504.html
Normal file
7
pages/504.html
Normal 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>
|
|
@ -1,21 +1,22 @@
|
||||||
{
|
{
|
||||||
"403": "You Shall Not Pass",
|
"202": "You In My Heart",
|
||||||
"301": "Your Princess Is In Another Castle",
|
|
||||||
"451": "Oi, You Got a Loicense For That Mate?",
|
|
||||||
"204": "Head Empty No Thoughts",
|
"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",
|
"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",
|
"413": "Me After a Night With Your Mother",
|
||||||
"417": "Me After 20-something Years With My 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",
|
"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",
|
"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"
|
||||||
}
|
}
|
|
@ -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
|
|
|
Loading…
Reference in a new issue