<commit_before>from base import ProxyModuleBase


class SampleModule(ProxyModuleBase):
    def onRequest(self, **kwargs):
        print self.request_object.clientproto
        self.request_object.clientproto = 'HTTP/1.1'
        self.request_object.uri = '/modified/url/'
        self.request_object.requestHeaders.removeHeader('user-agent')
        self.request_object.requestHeaders.setRawHeaders('user-agent', ['HeliosBurn proxy ADDED ON REQUEST'])
        self.request_object.requestHeaders.addRawHeader('My-Header', '312')
        self.request_object.method = 'GET'

    def onResponse(self, **kwargs):
        print self.response_object.father.code
        print self.response_object.father.code_message
        print self.response_object.father.responseHeaders
        print self.response_object.father.clientproto
        self.response_object.father.setResponseCode(500, "Internal Server Error")
        self.response_object.father.responseHeaders.addRawHeader("Custom-Header", "Proxied by Helios ADDED ON RESPONSE")<commit_msg>removed URL modifier from samplemodule.py, was breaking unit tests.<commit_after>from base import ProxyModuleBase


class SampleModule(ProxyModuleBase):
    def onRequest(self, **kwargs):
        print self.request_object.clientproto
        self.request_object.clientproto = 'HTTP/1.1'
        #self.request_object.uri = '/modified/url/'
        self.request_object.requestHeaders.removeHeader('user-agent')
        self.request_object.requestHeaders.setRawHeaders('user-agent', ['HeliosBurn proxy ADDED ON REQUEST'])
        self.request_object.requestHeaders.addRawHeader('My-Header', '312')
        self.request_object.method = 'GET'

    def onResponse(self, **kwargs):
        print self.response_object.father.code
        print self.response_object.father.code_message
        print self.response_object.father.responseHeaders
        print self.response_object.father.clientproto
        self.response_object.father.responseHeaders.addRawHeader("Custom-Header", "Proxied by Helios ADDED ON RESPONSE")
{'fraction_non_alphanumeric': 0.09975550122249388, 'fraction_numerical': 0.006356968215158924, 'mean_word_length': 3.918269230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2965386', 'n_tokens_mistral': 574, 'n_tokens_neox': 559, 'n_words': 99}