t_pkg_depotd.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:solaris-ips 作者: oracle 项目源码 文件源码
def test_face_root(self):
                """Verify that files outside of the package content web root
                cannot be accessed, and that files inside can be."""
                depot_url = self.dc.get_depot_url()
                # Since /usr/share/lib/pkg/web/ is the content web root,
                # any attempts to go outside that directory should fail
                # with a 404 error.
                try:
                        urlopen("{0}/../../../../bin/pkg".format(depot_url))
                except HTTPError as e:
                        if e.code != http_client.NOT_FOUND:
                                raise

                f = urlopen("{0}/robots.txt".format(depot_url))
                self.assertTrue(len(f.read()))
                f.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号