File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9999 True ,
100100 "https://example.com/home/user/file%20%0A" ,
101101 ),
102+ # No path component
103+ ("http://example.com" , False , "http://example.com" ),
104+ ("http://example.com" , True , "https://example.com" ),
105+ # Root path only
106+ ("http://example.com/" , False , "http://example.com/" ),
107+ ("http://example.com/" , True , "https://example.com/" ),
108+ # Scheme downgrade (https input, enable_https=False)
109+ (
110+ "https://example.com/usr/local/bin" ,
111+ False ,
112+ "http://example.com/usr/local/bin" ,
113+ ),
114+ (
115+ "https://example.com/usr/local/bin" ,
116+ True ,
117+ "https://example.com/usr/local/bin" ,
118+ ),
119+ # Netloc with port
120+ (
121+ "http://example.com:8080/data/file.bin" ,
122+ False ,
123+ "http://example.com:8080/data/file.bin" ,
124+ ),
125+ (
126+ "http://example.com:8080/data/file.bin" ,
127+ True ,
128+ "https://example.com:8080/data/file.bin" ,
129+ ),
102130 ),
103131)
104132def test_process_raw_url (_input : str , _enable_https : bool , _expected : str ):
You can’t perform that action at this time.
0 commit comments