Esempio n. 1
0
def new_no_content_resp(uri, add_id=False):
    """
    Return a new NO_CONTENT HTTPResponse object.
    
    :param uri: URI string or request object
    """
    no_content_response = HTTPResponse(NO_CONTENT, '', Headers(), uri,
                                       uri, msg='No Content')

    if add_id:
        no_content_response.id = consecutive_number_generator.inc()

    return no_content_response
Esempio n. 2
0
def new_no_content_resp(uri, add_id=False):
    """
    Return a new NO_CONTENT HTTPResponse object.
    
    :param uri: URI string or request object
    """
    no_content_response = HTTPResponse(NO_CONTENT, '', Headers(), uri,
                                       uri, msg='No Content')

    if add_id:
        no_content_response.id = consecutive_number_generator.inc()

    return no_content_response
Esempio n. 3
0
def new_no_content_resp(uri, add_id=False):
    """
    Return a new NO_CONTENT HTTPResponse object.
    
    :param uri: URI string or request object
    :param add_id: Add ID to the HTTP response
    """
    #
    # WARNING: You are about to change this code? Please read the related
    #          race condition in this commit [0]
    #
    # [0] https://github.com/andresriancho/w3af/commit/682bc2e4ad7d075bbdc469bc5d24a28e6d2e7804
    #
    no_content_response = HTTPResponse(code=NO_CONTENT,
                                       read='',
                                       headers=Headers(),
                                       geturl=uri,
                                       original_url=uri,
                                       msg=NO_CONTENT_MSG)

    if add_id:
        no_content_response.id = consecutive_number_generator.inc()

    return no_content_response