(self)
Test HTTP methods and log their status code
        and whether the method is allowed or not.

        Args:
            None

        Returns:
            None

        Raises:
            None
Test HTTP methods and log their status code
        and whether the method is allowed or not.
Test HTTP methods and log their status code and whether the method is allowed or not .
def find_http_methods(self):
        """
        Test HTTP methods and log their status code
        and whether the method is allowed or not.

        Args:
            None

        Returns:
            None

        Raises:
            None
        """
        modes_list = ['GET',
                      'POST',
                      'PUT',
                      'DELETE',
                      'OPTIONS',
                      'TRACE',
                      'TEST']

        for mode in modes_list:
            resp = requests.request(mode, self.url)
            mode_msg = "{0}: {1} - {2}".format(mode,
                                             resp.status_code,
                                             resp.reason)
            self.logger.log(
                mode_msg,
                logtype="info"
            )

            if (mode == 'TRACE' and
                'TRACE / HTTP/1.1' in resp.text):
                self.logger.log(
                    "Cross Site Tracing vulnerability found.",
                    logtype="warning"
                )
def find_http_methods ( self ) : modes_list = [ 'GET' , 'POST' , 'PUT' , 'DELETE' , 'OPTIONS' , 'TRACE' , 'TEST' ] for mode in modes_list : resp = requests . request ( mode , self . url ) mode_msg = "{0}: {1} - {2}" . format ( mode , resp . status_code , resp . reason ) self . logger . log ( mode_msg , logtype = "info" ) if ( mode == 'TRACE' and 'TRACE / HTTP/1.1' in resp . text ) : self . logger . log ( "Cross Site Tracing vulnerability found." , logtype = "warning" )