Skip to content

Commit

Permalink
fix(linker): normalize the URL before querying for a domain name.
Browse files Browse the repository at this point in the history
This will remove the extra www. if it appears.
  • Loading branch information
nsantacruz committed Jan 28, 2024
1 parent 650be27 commit b07d4f5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sefaria/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ def find_refs_api(request):
@api_view(["GET"])
def websites_api(request, domain):
cb = request.GET.get("callback", None)
domain = WebPage.normalize_url(domain)
website = WebSite().load({"domains": domain})
if website is None:
return jsonResponse({"error": f"no website found with domain: '{domain}'"})
Expand Down

0 comments on commit b07d4f5

Please sign in to comment.