How to use the urlpath.JailedURL function in urlpath

To help you get started, we’ve selected a few urlpath examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chrono-meter / urlpath / test / test_url.py View on Github external
def test_webob_jail(self):
        request = webob.Request.blank('/path/to/filename.ext', {'SCRIPT_NAME': '/app/root'})

        self.assertEqual(request.application_url, 'http://localhost/app/root')
        self.assertEqual(request.url, 'http://localhost/app/root/path/to/filename.ext')

        url = JailedURL(request)

        self.assertEqual(str(url.chroot), 'http://localhost/app/root')
        self.assertEqual(str(url), 'http://localhost/app/root/path/to/filename.ext')
github chrono-meter / urlpath / urlpath.py View on Github external
def jailed(self):
        return JailedURL(self, root=self)

urlpath

Object-oriented URL from `urllib.parse` and `pathlib`

Python-2.0
Latest version published 3 years ago

Package Health Score

43 / 100
Full package analysis