return {"blocks": result}
@app.get(base_url+"/")
-def index(request: Request, domain: str = None, reason: str = None, wildcards: str = None):
+def index(request: Request, domain: str = None, reason: str = None):
if domain == "" or reason == "":
return responses.RedirectResponse("/")
info = None
if not blocks.ok:
raise HTTPException(status_code=blocks.status_code, detail=blocks.text)
blocks = blocks.json()
- return templates.TemplateResponse("index.html", {"request": request, "domain": domain, "blocks": blocks, "wildcards": wildcards, "reason": reason, "info": info})
+ return templates.TemplateResponse("index.html", {"request": request, "domain": domain, "blocks": blocks, "reason": reason, "info": info})
if __name__ == "__main__":
uvicorn.run("api:app", host="127.0.0.1", port=port, log_level="info")
<div class="block">
<img src="https://proxy.duckduckgo.com/ip3/{{block}}.ico" width=16/>
<b><a href="https://{{block}}">{{block}}</a></b>
- {% if block in wildcards %}
+ {% if block in blocks.wildcards %}
(<span title="wildcard block">∗</span>)
{% endif %}
<br/>