Compare commits

...

2 Commits

Author SHA1 Message Date
051c1a1441 explicitly set CORSMiddleware options 2024-04-13 19:40:20 -04:00
bcf4dd27b7 rename function 2024-04-13 19:31:00 -04:00

View File

@ -12,12 +12,14 @@ app = FastAPI(docs_url=None, redoc_url=None)
app.add_middleware( app.add_middleware(
CORSMiddleware, CORSMiddleware,
allow_origins=["*"], allow_origins=["*"],
allow_methods=["GET"] allow_credentials=False,
allow_methods=["GET"],
allow_headers=["*"]
) )
@app.get('/') @app.get('/')
async def shorten_url(url: Optional[str] = None): async def unshorten_url(url: Optional[str] = None):
if url is None: if url is None:
return {"error": "no url provided"} return {"error": "no url provided"}