Exemple #1
0
    async def test_xforwarded_mode_without_trusted_hosts(
            self, mock_xforwarded_relaxed, mock_xforwarded_strict):
        """ Test that when the aiohttp app have some trusted hosts specified at
        initialization, the XForwardedStrict method is applied.
        """
        args = self.get_args()
        args.extend(['--trusted'])
        parser, args = httpproxy.parse_args(self.get_args())
        httpproxy.get_app(args)

        mock_xforwarded_relaxed.called
        not mock_xforwarded_strict.called
Exemple #2
0
 async def get_application(self):
     """
     Override the get_app method to return your application.
     """
     parser, args = httpproxy.parse_args(self.get_args())
     return httpproxy.get_app(args)