def header_canonical(self, header_name):
        """Translate HTTP headers to Django header names."""
        # Translate as stated in the docs:
        # https://docs.djangoproject.com/en/1.6/ref/request-response/#django.http.HttpRequest.META
        header_name = header_name.lower()
        if header_name == 'content-type':
            return 'CONTENT-TYPE'
        elif header_name == 'content-length':
            return 'CONTENT-LENGTH'
        return 'HTTP_%s' % header_name.replace('-', '_').upper()
def header_canonical ( self , header_name ) : header_name = header_name . lower ( ) if header_name == 'content-type' : return 'CONTENT-TYPE' elif header_name == 'content-length' : return 'CONTENT-LENGTH' return 'HTTP_%s' % header_name . replace ( '-' , '_' ) . upper ( )
Translate HTTP headers to Django header names.