From 41ecaad07da57a9d0e96432c8adcd9b63e6fddb3 Mon Sep 17 00:00:00 2001 From: bashrc Date: Mon, 23 Feb 2026 17:05:44 +0000 Subject: [PATCH] Use functions to obtain domain and port --- session.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/session.py b/session.py index 6ffd50735..99f2cd054 100644 --- a/session.py +++ b/session.py @@ -15,6 +15,8 @@ from socket import error as SocketError from http.client import HTTPConnection from flags import is_image_file from flags import url_permitted +from utils import get_port_from_domain +from utils import remove_domain_port from utils import text_in_file from utils import acct_dir from utils import binary_is_image @@ -240,8 +242,8 @@ def _get_json_signed(session, url: str, domain_full: str, session_headers: {}, to_domain_full = to_domain_full.split('/')[0] if ':' in domain_full: - domain = domain_full.split(':')[0] - port = domain_full.split(':')[1] + domain = remove_domain_port(domain_full) + port = get_port_from_domain(domain_full) else: domain = domain_full if http_prefix == 'https': @@ -250,8 +252,8 @@ def _get_json_signed(session, url: str, domain_full: str, session_headers: {}, port = 80 if ':' in to_domain_full: - to_domain = to_domain_full.split(':')[0] - to_port = to_domain_full.split(':')[1] + to_domain = remove_domain_port(to_domain_full) + to_port = get_port_from_domain(to_domain_full) else: to_domain = to_domain_full if http_prefix == 'https':