From 4296afee69abb24bb8c3402f47970083e9a3ef77 Mon Sep 17 00:00:00 2001 From: agatha Date: Sat, 13 Apr 2024 21:03:20 -0400 Subject: [PATCH] rename UNSHORTENERS --- server/src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/main.py b/server/src/main.py index 094b778..32bf17e 100644 --- a/server/src/main.py +++ b/server/src/main.py @@ -5,7 +5,7 @@ from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from unshorteners import unshorten_twitter -UNSHORTENERS = { +UNSHORTEN = { 't.co': unshorten_twitter } @@ -26,7 +26,7 @@ async def receive_url(url: Optional[str] = None): return {"error": "no url provided"} domain = urlparse(url).netloc - if domain not in UNSHORTENERS: + if domain not in UNSHORTEN: return {"error": f"cannot unshorten {domain}"} - return UNSHORTENERS[domain](url) + return UNSHORTEN[domain](url)