From e7a5ccf74fe4f1b2bfcca5597f5784ed7a0acb38 Mon Sep 17 00:00:00 2001
From: swee
Date: Mon, 13 Jan 2025 20:28:54 -0800
Subject: [PATCH] Update server.py
---
server.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/server.py b/server.py
index edd1603..aff8636 100644
--- a/server.py
+++ b/server.py
@@ -1,6 +1,6 @@
#!/usr/bin/python3
import asyncio, traceback, socket, ssl
-from urllib.parse import urlparse
+from urllib.parse import urlparse, quote
from flask import Flask, request, redirect, send_file, Response
from hypercorn.config import Config
from hypercorn.asyncio import serve
@@ -70,7 +70,7 @@ def relay():
i = i.replace("<", "<")
if firstline:
if i.split(" ")[0][0] == "3":
- return redirect("/gem?gemini=" + i.split(" ")[1][9:])
+ return redirect("/gem?gemini=" + quote(i.split(" ")[1][9:], safe=''))
elif i.split(" ")[0][0] == "1":
return f'\nInput requiredInput required
The specified Gemini server wants more data: "
{i}
"
'
elif i.split(" ")[0][0] != "2":