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