From 3a78df7d613c61bf74a43ec023af23b47c9b5635 Mon Sep 17 00:00:00 2001 From: a Date: Mon, 11 Aug 2025 05:09:55 +0000 Subject: fixes http in url --- main_server.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main_server.go') diff --git a/main_server.go b/main_server.go index 00d3938..a17d788 100644 --- a/main_server.go +++ b/main_server.go @@ -50,13 +50,13 @@ func gen_hash(url string) string{ } func correct_url(url string) string { - if(len(url) <= 7) { - return "https://" + url; + if(url[:7] == "https:/") { + return "https://" + url[7:]; } - if(url[:8] != "https://") { - return "https://" + url; + if(url[:6] == "http:/") { + return "http://" + url[:6]; } - return url; + return "https://" + url; } func add_url(url string) string{ -- cgit v1.2.3