gem

a fork of khuxkm's gemini to web proxy
Log | Files | Refs

commit f05af1e5e9433435c1c81dbdfd0e6b4ee89cfea6
parent 083d4cb8d0fac2b4f267360c3e85706c18c6bd98
Author: xfnw <xfnw@ttm.sh>
Date:   Fri, 11 Dec 2020 11:05:35 -0500

fancy error messages

Diffstat:
Mindex.cgi | 25+++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/index.cgi b/index.cgi @@ -239,8 +239,33 @@ elif response.status==ResponseCodes.GENERIC_TEMPFAIL or response.status==Respons print(f"Error {response.status}: {msg}") print(f"Server says: {response.meta}") elif response.status==ResponseCodes.GENERIC_CERTFAIL: + print("""Content-Type: text/html + +<!DOCTYPE html> +<html> +<head> +<title>Cert Error...</title> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<link rel="stylesheet" href="gem.css"> +</head> +<body> +<pre>""") print("Page requires the use of client certificates, which are outside the scope of this proxy.") else: + print("""Content-Type: text/html + +<!DOCTYPE html> +<html> +<head> +<title>Unknown Error...</title> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<link rel="stylesheet" href="gem.css"> +</head> +<body> +<pre>""") print("Page returned status code {} which is unimplemented.".format(response.status)) print("META = {!r}".format(response.meta)) print("Response body = {!r}".format(response.content)) +