File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -986,6 +986,28 @@ async def get(self) -> web.Response:
986986 await r .release ()
987987
988988
989+ @pytest .mark .xfail (reason = "https://github.com/aio-libs/aiohttp/issues/11665" )
990+ async def test_subapp_domain_routing_same_path (aiohttp_client : AiohttpClient ) -> None :
991+ app = web .Application ()
992+ sub_app = web .Application ()
993+
994+ async def mainapp_handler (request : web .Request ) -> web .Response :
995+ assert False
996+
997+ async def subapp_handler (request : web .Request ) -> web .Response :
998+ return web .Response (text = "SUBAPP" )
999+
1000+ app .router .add_get ("/" , mainapp_handler )
1001+ sub_app .router .add_get ("/" , subapp_handler )
1002+ app .add_domain ("different.example.com" , sub_app )
1003+
1004+ client = await aiohttp_client (app )
1005+ async with client .get ("/" , headers = {"Host" : "different.example.com" }) as r :
1006+ assert r .status == 200
1007+ result = await r .text ()
1008+ assert result == "SUBAPP"
1009+
1010+
9891011async def test_route_with_regex (aiohttp_client : AiohttpClient ) -> None :
9901012 """Test a route with a regex preceded by a fixed string."""
9911013 app = web .Application ()
You can’t perform that action at this time.
0 commit comments