@@ -219,32 +219,40 @@ def test_request_attributes_with_partial_raw_uri_and_nonstandard_port(
219
219
self .environ ["SERVER_PORT" ] = "8080"
220
220
self .validate_url ("http://127.0.0.1:8080/?" )
221
221
222
+ def test_https_uri_port (self ):
223
+ del self .environ ["HTTP_HOST" ]
224
+ self .environ ["SERVER_PORT" ] = "443"
225
+ self .environ ["wsgi.url_scheme" ] = "https"
226
+ self .validate_url ("https://127.0.0.1/" )
227
+
228
+ self .environ ["SERVER_PORT" ] = "8080"
229
+ self .validate_url ("https://127.0.0.1:8080/" )
230
+
231
+ self .environ ["SERVER_PORT" ] = "80"
232
+ self .validate_url ("https://127.0.0.1:80/" )
233
+
222
234
def test_request_attributes_with_nonstandard_port_and_no_host (self ):
223
235
del self .environ ["HTTP_HOST" ]
224
236
self .environ ["SERVER_PORT" ] = "8080"
225
237
self .validate_url ("http://127.0.0.1:8080/" )
226
238
239
+ self .environ ["SERVER_PORT" ] = "443"
240
+ self .validate_url ("http://127.0.0.1:443/" )
241
+
227
242
def test_request_attributes_with_nonstandard_port (self ):
228
243
self .environ ["HTTP_HOST" ] += ":8080"
229
244
self .validate_url ("http://127.0.0.1:8080/" )
230
245
231
- def test_request_attributes_with_scheme_relative_raw_uri (self ):
246
+ def test_request_attributes_with_faux_scheme_relative_raw_uri (self ):
232
247
self .environ ["RAW_URI" ] = "//127.0.0.1/?"
233
- self .validate_url ("http://127.0.0.1/?" )
234
-
235
- def test_request_attributes_with_netlocless_raw_uri (self ):
236
- self .environ ["RAW_URI" ] = "http:///?"
237
- self .validate_url ("http://127.0.0.1/?" )
248
+ self .validate_url ("http://127.0.0.1//127.0.0.1/?" )
238
249
239
250
def test_request_attributes_with_pathless_raw_uri (self ):
251
+ self .environ ["PATH_INFO" ] = ""
240
252
self .environ ["RAW_URI" ] = "http://hello"
241
253
self .environ ["HTTP_HOST" ] = "hello"
242
254
self .validate_url ("http://hello" )
243
255
244
- def test_request_attributes_with_strange_raw_uri (self ):
245
- self .environ ["RAW_URI" ] = "http://?"
246
- self .validate_url ("http://127.0.0.1?" )
247
-
248
256
def test_request_attributes_with_full_request_uri (self ):
249
257
self .environ ["HTTP_HOST" ] = "127.0.0.1:8080"
250
258
self .environ ["REQUEST_URI" ] = "http://127.0.0.1:8080/?foo=bar#top"
0 commit comments