Initial commit
This commit is contained in:
commit
aec721db2d
24 changed files with 268 additions and 0 deletions
61
README.md
Normal file
61
README.md
Normal file
|
@ -0,0 +1,61 @@
|
|||
# askiiart/http-codes
|
||||
|
||||
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:
|
||||
|
||||
- 403 [You Shall Not Pass](https://0w0.is/notice/AZpeq9kdiVbKocpo0m)
|
||||
- 301 [Your Princess in in Another Castle](https://0w0.is/notice/AZpfAtcGtx1gr4oHVg)
|
||||
- 451 [Oi, You Got a Loicense For That Mate?](https://0w0.is/notice/AZpfQAPElAI5GszkAa)
|
||||
- 204 [Head Empty No Thoughts](https://0w0.is/notice/AZpfdFJboofeGHbCUa)
|
||||
- 402 [Come Back When You're a Little MMMMM Richer](https://0w0.is/notice/AZpfvcOck8SL3fhmwS)
|
||||
- 413 [Me After A Night With Your Mother](https://0w0.is/notice/AZpgMXPNObkTPJtSKW)
|
||||
- 417 me after 20-something years with my mother (from [Evvy](https://tech.lgbt/@pierogiburo/111076180358295709))
|
||||
- 502 [Forgive Me Father For My Gateway Has Sinned](https://0w0.is/notice/AZpgs0f6gIa775G4DQ)
|
||||
- 504 Note: Gateway died on the way back to its home planet (from [spectrums i'm on: at least two](https://realworldsunny.name/notes/9k8j3jo5hf))
|
||||
- [508 508 508 508 508 508 508 508 508 508 508 508 508 508 508](https://0w0.is/notice/AZph3gHkGe5BOHtdJo)
|
||||
- 418 [I'm A Teapot](https://0w0.is/notice/AZph69mBakLHR0JbVY)
|
||||
(this is just the real one)
|
||||
- 410 [Your Father](https://0w0.is/notice/AZphDH230s43xu7zxQ)
|
||||
- 406 [I Can't Believe You've Done This](https://0w0.is/notice/AZphGgRsyF6Zf8q71c)
|
||||
- 401 [This Is Against TOS You've Been
|
||||
Reported](https://0w0.is/notice/AZphX4T5R1ksn5DPxA)
|
||||
- 425 [Sorry This Never Happens With Other
|
||||
Women](https://0w0.is/notice/AZphi280TWwAicaBVI)
|
||||
- 202 [You In My Heart](https://0w0.is/notice/AZpiODVUYkViAigMfA)
|
||||
- 300 [Poll](https://0w0.is/notice/AZpicIzowoUZFaaPdg)
|
||||
- 57% Yes
|
||||
- 43% No
|
||||
- (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)
|
||||
|
||||
## nginx rule
|
||||
|
||||
```nginx
|
||||
error_page 202 /error/202.html;
|
||||
error_page 204 /error/204.html;
|
||||
error_page 300 /error/300.html;
|
||||
error_page 301 /error/301.html;
|
||||
error_page 401 /error/401.html;
|
||||
error_page 402 /error/402.html;
|
||||
error_page 403 /error/403.html;
|
||||
error_page 404 /error/404.html;
|
||||
error_page 406 /error/406.html;
|
||||
error_page 410 /error/410.html;
|
||||
error_page 413 /error/413.html;
|
||||
error_page 417 /error/417.html;
|
||||
error_page 418 /error/418.html;
|
||||
error_page 423 /error/423.html;
|
||||
error_page 425 /error/425.html;
|
||||
error_page 429 /error/429.html;
|
||||
error_page 451 /error/451.html;
|
||||
error_page 502 /error/502.html;
|
||||
error_page 508 /error/508.html;
|
||||
```
|
22
nginx-create-pages.py
Normal file
22
nginx-create-pages.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import requests
|
||||
import os
|
||||
import json
|
||||
|
||||
url_404 = 'https://askiiart.net/sdlfjsadljfs'
|
||||
html_404 = str(requests.get(url_404).text)
|
||||
|
||||
try:
|
||||
os.mkdir('pages')
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
with open('status-codes.json', 'r') as codes_file:
|
||||
codes_dict = json.load(codes_file)
|
||||
|
||||
for code in codes_dict:
|
||||
new_html = html_404.replace('404 Not Found', f'{code} {codes_dict[code]}')
|
||||
with open(f'pages/{code}.html', 'w') as new_file:
|
||||
new_file.write(new_html)
|
||||
|
||||
|
||||
exit()
|
7
pages/202.html
Normal file
7
pages/202.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>202 You In My Heart</title></head>
|
||||
<body>
|
||||
<center><h1>202 You In My Heart</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/204.html
Normal file
7
pages/204.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>204 Head Empty No Thoughts</title></head>
|
||||
<body>
|
||||
<center><h1>204 Head Empty No Thoughts</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/300.html
Normal file
7
pages/300.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>300 Poll</title></head>
|
||||
<body>
|
||||
<center><h1>300 Poll</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/301.html
Normal file
7
pages/301.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>301 Your Princess Is In Another Castle</title></head>
|
||||
<body>
|
||||
<center><h1>301 Your Princess Is In Another Castle</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/401.html
Normal file
7
pages/401.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>401 This Is Against TOS You've Been Reported</title></head>
|
||||
<body>
|
||||
<center><h1>401 This Is Against TOS You've Been Reported</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/402.html
Normal file
7
pages/402.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>402 Come Back When You're a Little MMMMMM Richer</title></head>
|
||||
<body>
|
||||
<center><h1>402 Come Back When You're a Little MMMMMM Richer</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/403.html
Normal file
7
pages/403.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>403 You Shall Not Pass</title></head>
|
||||
<body>
|
||||
<center><h1>403 You Shall Not Pass</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/404.html
Normal file
7
pages/404.html
Normal file
|
@ -0,0 +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>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/406.html
Normal file
7
pages/406.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>406 I Can't Believe You've Done This</title></head>
|
||||
<body>
|
||||
<center><h1>406 I Can't Believe You've Done This</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/410.html
Normal file
7
pages/410.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>410 Your Father</title></head>
|
||||
<body>
|
||||
<center><h1>410 Your Father</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/413.html
Normal file
7
pages/413.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>413 Me After a Night With Your Mother</title></head>
|
||||
<body>
|
||||
<center><h1>413 Me After a Night With Your Mother</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/417.html
Normal file
7
pages/417.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>417 Me After 20-something Years With My Mother</title></head>
|
||||
<body>
|
||||
<center><h1>417 Me After 20-something Years With My Mother</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/418.html
Normal file
7
pages/418.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>418 I'm a Teapot</title></head>
|
||||
<body>
|
||||
<center><h1>418 I'm a Teapot</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/423.html
Normal file
7
pages/423.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>423 Fine Then, Keep Your Secrets</title></head>
|
||||
<body>
|
||||
<center><h1>423 Fine Then, Keep Your Secrets</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/425.html
Normal file
7
pages/425.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>425 Sorry This Never Happens With Other Women</title></head>
|
||||
<body>
|
||||
<center><h1>425 Sorry This Never Happens With Other Women</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/429.html
Normal file
7
pages/429.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>429 i'm scared stop asking me q.q</title></head>
|
||||
<body>
|
||||
<center><h1>429 i'm scared stop asking me q.q</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/451.html
Normal file
7
pages/451.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>451 Oi, You Got a Loicense For That Mate?</title></head>
|
||||
<body>
|
||||
<center><h1>451 Oi, You Got a Loicense For That Mate?</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/502.html
Normal file
7
pages/502.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>502 Forgive Me Father For My Gateway Has Sinned</title></head>
|
||||
<body>
|
||||
<center><h1>502 Forgive Me Father For My Gateway Has Sinned</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
7
pages/508.html
Normal file
7
pages/508.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<head><title>508 508 508 508 508 508 508 508 508 508 508 508 508 508 508</title></head>
|
||||
<body>
|
||||
<center><h1>508 508 508 508 508 508 508 508 508 508 508 508 508 508 508</h1></center>
|
||||
<hr><center>nginx/1.25.3</center>
|
||||
</body>
|
||||
</html>
|
21
status-codes.json
Normal file
21
status-codes.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"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"
|
||||
}
|
19
status-codes.tsv
Normal file
19
status-codes.tsv
Normal file
|
@ -0,0 +1,19 @@
|
|||
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
|
|
12
tsv-to-json.py
Normal file
12
tsv-to-json.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
import csv
|
||||
import json
|
||||
|
||||
data = {}
|
||||
|
||||
with open('status-codes.tsv', 'r') as tsvfile:
|
||||
reader = csv.reader(tsvfile, delimiter=';')
|
||||
for row in reader:
|
||||
data[row[0]] = row[1]
|
||||
|
||||
with open('status-codes.json', 'w') as jsonfile:
|
||||
json.dump(data, jsonfile, indent=4)
|
Loading…
Reference in a new issue