cainiaocome / proxpy

Automatically exported from code.google.com/p/proxpy
0 stars 0 forks source link

AddHeader method adds an empty value as header name. #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add req.addHeader methon to def proxy_mangle_request(req):
2. Check the header in this request at method output

What is the expected output? What do you see instead?
Header should be added in format:
Name: Value

Actual:
Header is added in format:
None: Value.

What version of the product are you using? On what operating system?
latest

Please provide any additional information below.
this is the new method:

 def addHeader(self, name, value, ignorecase = True):
        """
        Add a new 'name' header with value 'value' to this HTTPMessage. If
        'ignorecase' is True, then the case of the header name is ignored.
        """
        k = self.__findHeader(name, ignorecase)
        if k not in self.headers:
            self.headers[name] = []
        self.headers[name].append(value)

Original issue reported on code.google.com by stu...@tacitknowledge.com on 9 Nov 2012 at 2:04

GoogleCodeExporter commented 8 years ago

Original comment by roberto.paleari@gmail.com on 18 Nov 2013 at 1:14