Ejemplo n.º 1
0
    def do_verbose_log(self, content):
        """
        Record in the verbose log the content as defined by Cyclone wrappers.
        """
        content = log_remove_escapes(content)
        content = log_encode_html(content)

        try:
            with open(GLSetting.httplogfile, 'a+') as fd:
                fdesc.writeToFD(fd.fileno(), content + "\n")
        except Exception as excep:
            log.err("Unable to open %s: %s" % (GLSetting.httplogfile, excep))
Ejemplo n.º 2
0
    def do_verbose_log(self, content):
        """
        Record in the verbose log the content as defined by Cyclone wrappers.
        """
        content = log_remove_escapes(content)
        content = log_encode_html(content)

        try:
            with open(GLSetting.httplogfile, 'a+') as fd:
                fdesc.writeToFD(fd.fileno(), content + "\n")
        except Exception as excep:
            log.err("Unable to open %s: %s" % (GLSetting.httplogfile, excep))
Ejemplo n.º 3
0
    def test_log_encode_html_str(self):
        self.assertEqual(utility.log_encode_html("<"), "&lt;")
        self.assertEqual(utility.log_encode_html(">"), "&gt;")
        self.assertEqual(utility.log_encode_html("'"), "&#39;")
        self.assertEqual(utility.log_encode_html("/"), "&#47;")
        self.assertEqual(utility.log_encode_html("\\"), "&#92;")

        self.assertEqual(utility.log_encode_html("<>'/\\"), "&lt;&gt;&#39;&#47;&#92;")
Ejemplo n.º 4
0
    def test_log_encode_html_str(self):
        self.assertEqual(utility.log_encode_html("<"), '&lt;')
        self.assertEqual(utility.log_encode_html(">"), '&gt;')
        self.assertEqual(utility.log_encode_html("'"), '&#39;')
        self.assertEqual(utility.log_encode_html("/"), '&#47;')
        self.assertEqual(utility.log_encode_html("\\"), '&#92;')

        self.assertEqual(utility.log_encode_html("<>'/\\"), '&lt;&gt;&#39;&#47;&#92;')
Ejemplo n.º 5
0
    def test_001_log_encode_html_str(self):
        self.assertEqual(utility.log_encode_html("<"), '&lt;')
        self.assertEqual(utility.log_encode_html(">"), '&gt;')
        self.assertEqual(utility.log_encode_html("'"), '&#39;')
        self.assertEqual(utility.log_encode_html("/"), '&#47;')
        self.assertEqual(utility.log_encode_html("\\"), '&#92;')

        self.assertEqual(utility.log_encode_html("<>'/\\"), '&lt;&gt;&#39;&#47;&#92;')