Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

return a full status, document headers to let user know he can get

whatever the case of the key and bump to 0.3.0
  • Loading branch information...
commit 81e3c659a6bfe9bfa13883fff6ec23f9bb21d5ee 1 parent 33d3529
Benoit Chesneau authored
2  http_parser/__init__.py
@@ -3,5 +3,5 @@
3 3 # This file is part of http_parser released under the MIT license.
4 4 # See the NOTICE for more information.
5 5
6   -version_info = (0, 2, 1)
  6 +version_info = (0, 3, 0)
7 7 __version__ = ".".join(map(str, version_info))
12 http_parser/http.py
@@ -7,6 +7,7 @@
7 7
8 8 from .parser import HttpParser
9 9 from .reader import HttpBodyReader
  10 +from .util import status_reasons
10 11
11 12 HTTP_BOTH = 2
12 13 HTTP_RESPONSE = 1
@@ -77,13 +78,22 @@ def status_code(self):
77 78 self._check_headers_complete()
78 79 return self.parser.get_status_code()
79 80
  81 + def status(self):
  82 + """ return complete status with reason """
  83 + status_code = self.status_code()
  84 + reason = status_reasons.get(int(status_code), 'unknown')
  85 + return "%s %s" % (status_code, reason)
  86 +
  87 +
80 88 def method(self):
81 89 """ get HTTP method as string"""
82 90 self._check_headers_complete()
83 91 return self.parser.get_method()
84 92
85 93 def headers(self):
86   - """ get request/response headers """
  94 + """ get request/response headers, headers are returned in a
  95 + OrderedDict that allows you to get value using insensitive
  96 + keys."""
87 97 self._check_headers_complete()
88 98 return self.parser.get_headers()
89 99
316 http_parser/parser.c
... ... @@ -1,4 +1,4 @@
1   -/* Generated by Cython 0.14.1 on Tue May 3 20:57:00 2011 */
  1 +/* Generated by Cython 0.14.1 on Tue May 3 21:12:15 2011 */
2 2
3 3 #define PY_SSIZE_T_CLEAN
4 4 #include "Python.h"
@@ -2793,26 +2793,26 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_8get_fragment(PyObj
2793 2793 * return self._data.fragment
2794 2794 *
2795 2795 * def get_headers(self): # <<<<<<<<<<<<<<
2796   - * """ get request/response headers """
2797   - * return self._data.headers
  2796 + * """ get request/response headers, headers are returned in a
  2797 + * OrderedDict that allows you to get value using insensitive keys. """
2798 2798 */
2799 2799
2800 2800 static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_9get_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2801   -static char __pyx_doc_11http_parser_6parser_10HttpParser_9get_headers[] = " get request/response headers ";
  2801 +static char __pyx_doc_11http_parser_6parser_10HttpParser_9get_headers[] = " get request/response headers, headers are returned in a\n OrderedDict that allows you to get value using insensitive keys. ";
2802 2802 static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_9get_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2803 2803 PyObject *__pyx_r = NULL;
2804 2804 PyObject *__pyx_t_1 = NULL;
2805 2805 __Pyx_RefNannySetupContext("get_headers");
2806 2806
2807   - /* "http_parser/parser.pyx":270
2808   - * def get_headers(self):
2809   - * """ get request/response headers """
  2807 + /* "http_parser/parser.pyx":271
  2808 + * """ get request/response headers, headers are returned in a
  2809 + * OrderedDict that allows you to get value using insensitive keys. """
2810 2810 * return self._data.headers # <<<<<<<<<<<<<<
2811 2811 *
2812 2812 * def get_wsgi_environ(self):
2813 2813 */
2814 2814 __Pyx_XDECREF(__pyx_r);
2815   - __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__headers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2815 + __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__headers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2816 2816 __Pyx_GOTREF(__pyx_t_1);
2817 2817 __pyx_r = __pyx_t_1;
2818 2818 __pyx_t_1 = 0;
@@ -2830,7 +2830,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_9get_headers(PyObje
2830 2830 return __pyx_r;
2831 2831 }
2832 2832
2833   -/* "http_parser/parser.pyx":272
  2833 +/* "http_parser/parser.pyx":273
2834 2834 * return self._data.headers
2835 2835 *
2836 2836 * def get_wsgi_environ(self): # <<<<<<<<<<<<<<
@@ -2861,20 +2861,20 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
2861 2861 __pyx_v_script_name = Py_None; __Pyx_INCREF(Py_None);
2862 2862 __pyx_v_path_info = Py_None; __Pyx_INCREF(Py_None);
2863 2863
2864   - /* "http_parser/parser.pyx":274
  2864 + /* "http_parser/parser.pyx":275
2865 2865 * def get_wsgi_environ(self):
2866 2866 * """ get WSGI environ based on the current request """
2867 2867 * environ = self._data.environ # <<<<<<<<<<<<<<
2868 2868 *
2869 2869 * # clean special keys
2870 2870 */
2871   - __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__environ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2871 + __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__environ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2872 2872 __Pyx_GOTREF(__pyx_t_1);
2873 2873 __Pyx_DECREF(__pyx_v_environ);
2874 2874 __pyx_v_environ = __pyx_t_1;
2875 2875 __pyx_t_1 = 0;
2876 2876
2877   - /* "http_parser/parser.pyx":277
  2877 + /* "http_parser/parser.pyx":278
2878 2878 *
2879 2879 * # clean special keys
2880 2880 * for key in ("CONTENT_LENGTH", "CONTENT_TYPE", "SCRIPT_NAME"): # <<<<<<<<<<<<<<
@@ -2889,48 +2889,48 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
2889 2889 __pyx_v_key = __pyx_t_3;
2890 2890 __pyx_t_3 = 0;
2891 2891
2892   - /* "http_parser/parser.pyx":278
  2892 + /* "http_parser/parser.pyx":279
2893 2893 * # clean special keys
2894 2894 * for key in ("CONTENT_LENGTH", "CONTENT_TYPE", "SCRIPT_NAME"):
2895 2895 * hkey = "HTTP_%s" % key # <<<<<<<<<<<<<<
2896 2896 * if hkey in environ:
2897 2897 * environ[key] = environ.pop(hkey)
2898 2898 */
2899   - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_v_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2899 + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_v_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2900 2900 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
2901 2901 __Pyx_DECREF(__pyx_v_hkey);
2902 2902 __pyx_v_hkey = ((PyObject *)__pyx_t_3);
2903 2903 __pyx_t_3 = 0;
2904 2904
2905   - /* "http_parser/parser.pyx":279
  2905 + /* "http_parser/parser.pyx":280
2906 2906 * for key in ("CONTENT_LENGTH", "CONTENT_TYPE", "SCRIPT_NAME"):
2907 2907 * hkey = "HTTP_%s" % key
2908 2908 * if hkey in environ: # <<<<<<<<<<<<<<
2909 2909 * environ[key] = environ.pop(hkey)
2910 2910 *
2911 2911 */
2912   - __pyx_t_4 = ((PySequence_Contains(__pyx_v_environ, __pyx_v_hkey))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2912 + __pyx_t_4 = ((PySequence_Contains(__pyx_v_environ, __pyx_v_hkey))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2913 2913 if (__pyx_t_4) {
2914 2914
2915   - /* "http_parser/parser.pyx":280
  2915 + /* "http_parser/parser.pyx":281
2916 2916 * hkey = "HTTP_%s" % key
2917 2917 * if hkey in environ:
2918 2918 * environ[key] = environ.pop(hkey) # <<<<<<<<<<<<<<
2919 2919 *
2920 2920 * script_name = environ.get('HTTP_SCRIPT_NAME',
2921 2921 */
2922   - __pyx_t_3 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__pop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2922 + __pyx_t_3 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__pop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2923 2923 __Pyx_GOTREF(__pyx_t_3);
2924   - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2924 + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2925 2925 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
2926 2926 __Pyx_INCREF(__pyx_v_hkey);
2927 2927 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_hkey);
2928 2928 __Pyx_GIVEREF(__pyx_v_hkey);
2929   - __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2929 + __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2930 2930 __Pyx_GOTREF(__pyx_t_6);
2931 2931 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2932 2932 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
2933   - if (PyObject_SetItem(__pyx_v_environ, __pyx_v_key, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2933 + if (PyObject_SetItem(__pyx_v_environ, __pyx_v_key, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2934 2934 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2935 2935 goto __pyx_L7;
2936 2936 }
@@ -2938,35 +2938,35 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
2938 2938 }
2939 2939 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2940 2940
2941   - /* "http_parser/parser.pyx":282
  2941 + /* "http_parser/parser.pyx":283
2942 2942 * environ[key] = environ.pop(hkey)
2943 2943 *
2944 2944 * script_name = environ.get('HTTP_SCRIPT_NAME', # <<<<<<<<<<<<<<
2945 2945 * os.environ.get("SCRIPT_NAME", ""))
2946 2946 *
2947 2947 */
2948   - __pyx_t_1 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2948 + __pyx_t_1 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2949 2949 __Pyx_GOTREF(__pyx_t_1);
2950 2950
2951   - /* "http_parser/parser.pyx":283
  2951 + /* "http_parser/parser.pyx":284
2952 2952 *
2953 2953 * script_name = environ.get('HTTP_SCRIPT_NAME',
2954 2954 * os.environ.get("SCRIPT_NAME", "")) # <<<<<<<<<<<<<<
2955 2955 *
2956 2956 * if script_name:
2957 2957 */
2958   - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2958 + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2959 2959 __Pyx_GOTREF(__pyx_t_6);
2960   - __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__environ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2960 + __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__environ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2961 2961 __Pyx_GOTREF(__pyx_t_5);
2962 2962 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2963   - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__get); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2963 + __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__get); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2964 2964 __Pyx_GOTREF(__pyx_t_6);
2965 2965 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2966   - __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2966 + __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2967 2967 __Pyx_GOTREF(__pyx_t_5);
2968 2968 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2969   - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2969 + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2970 2970 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
2971 2971 __Pyx_INCREF(((PyObject *)__pyx_n_s__HTTP_SCRIPT_NAME));
2972 2972 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__HTTP_SCRIPT_NAME));
@@ -2974,7 +2974,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
2974 2974 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
2975 2975 __Pyx_GIVEREF(__pyx_t_5);
2976 2976 __pyx_t_5 = 0;
2977   - __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2977 + __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2978 2978 __Pyx_GOTREF(__pyx_t_5);
2979 2979 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2980 2980 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
@@ -2982,42 +2982,42 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
2982 2982 __pyx_v_script_name = __pyx_t_5;
2983 2983 __pyx_t_5 = 0;
2984 2984
2985   - /* "http_parser/parser.pyx":285
  2985 + /* "http_parser/parser.pyx":286
2986 2986 * os.environ.get("SCRIPT_NAME", ""))
2987 2987 *
2988 2988 * if script_name: # <<<<<<<<<<<<<<
2989 2989 * path_info = self.get_path()
2990 2990 * path_info = path_info.split(script_name, 1)[1]
2991 2991 */
2992   - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_script_name); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2992 + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_script_name); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2993 2993 if (__pyx_t_4) {
2994 2994
2995   - /* "http_parser/parser.pyx":286
  2995 + /* "http_parser/parser.pyx":287
2996 2996 *
2997 2997 * if script_name:
2998 2998 * path_info = self.get_path() # <<<<<<<<<<<<<<
2999 2999 * path_info = path_info.split(script_name, 1)[1]
3000 3000 * environ.update({
3001 3001 */
3002   - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3002 + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3003 3003 __Pyx_GOTREF(__pyx_t_5);
3004   - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3004 + __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3005 3005 __Pyx_GOTREF(__pyx_t_6);
3006 3006 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3007 3007 __Pyx_DECREF(__pyx_v_path_info);
3008 3008 __pyx_v_path_info = __pyx_t_6;
3009 3009 __pyx_t_6 = 0;
3010 3010
3011   - /* "http_parser/parser.pyx":287
  3011 + /* "http_parser/parser.pyx":288
3012 3012 * if script_name:
3013 3013 * path_info = self.get_path()
3014 3014 * path_info = path_info.split(script_name, 1)[1] # <<<<<<<<<<<<<<
3015 3015 * environ.update({
3016 3016 * 'PATH_INFO': path_info,
3017 3017 */
3018   - __pyx_t_6 = PyObject_GetAttr(__pyx_v_path_info, __pyx_n_s__split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3018 + __pyx_t_6 = PyObject_GetAttr(__pyx_v_path_info, __pyx_n_s__split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3019 3019 __Pyx_GOTREF(__pyx_t_6);
3020   - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3020 + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3021 3021 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
3022 3022 __Pyx_INCREF(__pyx_v_script_name);
3023 3023 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_script_name);
@@ -3025,52 +3025,52 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
3025 3025 __Pyx_INCREF(__pyx_int_1);
3026 3026 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_1);
3027 3027 __Pyx_GIVEREF(__pyx_int_1);
3028   - __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3028 + __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3029 3029 __Pyx_GOTREF(__pyx_t_1);
3030 3030 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3031 3031 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3032   - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3032 + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3033 3033 __Pyx_GOTREF(__pyx_t_5);
3034 3034 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3035 3035 __Pyx_DECREF(__pyx_v_path_info);
3036 3036 __pyx_v_path_info = __pyx_t_5;
3037 3037 __pyx_t_5 = 0;
3038 3038
3039   - /* "http_parser/parser.pyx":288
  3039 + /* "http_parser/parser.pyx":289
3040 3040 * path_info = self.get_path()
3041 3041 * path_info = path_info.split(script_name, 1)[1]
3042 3042 * environ.update({ # <<<<<<<<<<<<<<
3043 3043 * 'PATH_INFO': path_info,
3044 3044 * 'SCRIPT_NAME': script_name})
3045 3045 */
3046   - __pyx_t_5 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__update); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3046 + __pyx_t_5 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__update); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3047 3047 __Pyx_GOTREF(__pyx_t_5);
3048   - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3048 + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3049 3049 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3050 3050
3051   - /* "http_parser/parser.pyx":289
  3051 + /* "http_parser/parser.pyx":290
3052 3052 * path_info = path_info.split(script_name, 1)[1]
3053 3053 * environ.update({
3054 3054 * 'PATH_INFO': path_info, # <<<<<<<<<<<<<<
3055 3055 * 'SCRIPT_NAME': script_name})
3056 3056 *
3057 3057 */
3058   - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__PATH_INFO), __pyx_v_path_info) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3058 + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__PATH_INFO), __pyx_v_path_info) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3059 3059
3060   - /* "http_parser/parser.pyx":290
  3060 + /* "http_parser/parser.pyx":291
3061 3061 * environ.update({
3062 3062 * 'PATH_INFO': path_info,
3063 3063 * 'SCRIPT_NAME': script_name}) # <<<<<<<<<<<<<<
3064 3064 *
3065 3065 * if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl":
3066 3066 */
3067   - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__SCRIPT_NAME), __pyx_v_script_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3068   - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3067 + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__SCRIPT_NAME), __pyx_v_script_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3068 + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3069 3069 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
3070 3070 PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
3071 3071 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
3072 3072 __pyx_t_1 = 0;
3073   - __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3073 + __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3074 3074 __Pyx_GOTREF(__pyx_t_1);
3075 3075 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3076 3076 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
@@ -3079,140 +3079,140 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
3079 3079 }
3080 3080 __pyx_L8:;
3081 3081
3082   - /* "http_parser/parser.pyx":292
  3082 + /* "http_parser/parser.pyx":293
3083 3083 * 'SCRIPT_NAME': script_name})
3084 3084 *
3085 3085 * if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl": # <<<<<<<<<<<<<<
3086 3086 * environ['wsgi.url_scheme']= "https"
3087 3087 * elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on":
3088 3088 */
3089   - __pyx_t_1 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3089 + __pyx_t_1 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3090 3090 __Pyx_GOTREF(__pyx_t_1);
3091   - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3091 + __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3092 3092 __Pyx_GOTREF(__pyx_t_6);
3093 3093 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3094   - __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3094 + __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3095 3095 __Pyx_GOTREF(__pyx_t_1);
3096 3096 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3097   - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3097 + __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3098 3098 __Pyx_GOTREF(__pyx_t_6);
3099 3099 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3100   - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__ssl), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3100 + __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__ssl), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3101 3101 __Pyx_GOTREF(__pyx_t_1);
3102 3102 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3103   - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3103 + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3104 3104 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3105 3105 if (__pyx_t_4) {
3106 3106
3107   - /* "http_parser/parser.pyx":293
  3107 + /* "http_parser/parser.pyx":294
3108 3108 *
3109 3109 * if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl":
3110 3110 * environ['wsgi.url_scheme']= "https" # <<<<<<<<<<<<<<
3111 3111 * elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on":
3112 3112 * environ['wsgi.url_scheme'] = "https"
3113 3113 */
3114   - if (PyObject_SetItem(__pyx_v_environ, ((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_n_s__https)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3114 + if (PyObject_SetItem(__pyx_v_environ, ((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_n_s__https)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3115 3115 goto __pyx_L9;
3116 3116 }
3117 3117
3118   - /* "http_parser/parser.pyx":294
  3118 + /* "http_parser/parser.pyx":295
3119 3119 * if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl":
3120 3120 * environ['wsgi.url_scheme']= "https"
3121 3121 * elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on": # <<<<<<<<<<<<<<
3122 3122 * environ['wsgi.url_scheme'] = "https"
3123 3123 * else:
3124 3124 */
3125   - __pyx_t_1 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3125 + __pyx_t_1 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3126 3126 __Pyx_GOTREF(__pyx_t_1);
3127   - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3127 + __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3128 3128 __Pyx_GOTREF(__pyx_t_6);
3129 3129 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3130   - __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3130 + __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3131 3131 __Pyx_GOTREF(__pyx_t_1);
3132 3132 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3133   - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3133 + __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3134 3134 __Pyx_GOTREF(__pyx_t_6);
3135 3135 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3136   - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__on), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3136 + __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__on), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3137 3137 __Pyx_GOTREF(__pyx_t_1);
3138 3138 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3139   - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3139 + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3140 3140 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3141 3141 if (__pyx_t_4) {
3142 3142
3143   - /* "http_parser/parser.pyx":295
  3143 + /* "http_parser/parser.pyx":296
3144 3144 * environ['wsgi.url_scheme']= "https"
3145 3145 * elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on":
3146 3146 * environ['wsgi.url_scheme'] = "https" # <<<<<<<<<<<<<<
3147 3147 * else:
3148 3148 * environ['wsgi.url_scheme'] = "http"
3149 3149 */
3150   - if (PyObject_SetItem(__pyx_v_environ, ((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_n_s__https)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3150 + if (PyObject_SetItem(__pyx_v_environ, ((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_n_s__https)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3151 3151 goto __pyx_L9;
3152 3152 }
3153 3153 /*else*/ {
3154 3154
3155   - /* "http_parser/parser.pyx":297
  3155 + /* "http_parser/parser.pyx":298
3156 3156 * environ['wsgi.url_scheme'] = "https"
3157 3157 * else:
3158 3158 * environ['wsgi.url_scheme'] = "http" # <<<<<<<<<<<<<<
3159 3159 *
3160 3160 * # add missing environ var
3161 3161 */
3162   - if (PyObject_SetItem(__pyx_v_environ, ((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_n_s__http)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3162 + if (PyObject_SetItem(__pyx_v_environ, ((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_n_s__http)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3163 3163 }
3164 3164 __pyx_L9:;
3165 3165
3166   - /* "http_parser/parser.pyx":300
  3166 + /* "http_parser/parser.pyx":301
3167 3167 *
3168 3168 * # add missing environ var
3169 3169 * environ.update({ # <<<<<<<<<<<<<<
3170 3170 * 'REQUEST_METHOD': self.get_method(),
3171 3171 * 'SERVER_PROTOCOL': "HTTP/%s" % ".".join(map(str,
3172 3172 */
3173   - __pyx_t_1 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__update); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3173 + __pyx_t_1 = PyObject_GetAttr(__pyx_v_environ, __pyx_n_s__update); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3174 3174 __Pyx_GOTREF(__pyx_t_1);
3175   - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3175 + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3176 3176 __Pyx_GOTREF(((PyObject *)__pyx_t_6));
3177 3177
3178   - /* "http_parser/parser.pyx":301
  3178 + /* "http_parser/parser.pyx":302
3179 3179 * # add missing environ var
3180 3180 * environ.update({
3181 3181 * 'REQUEST_METHOD': self.get_method(), # <<<<<<<<<<<<<<
3182 3182 * 'SERVER_PROTOCOL': "HTTP/%s" % ".".join(map(str,
3183 3183 * self.get_version()))})
3184 3184 */
3185   - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_method); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3185 + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_method); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3186 3186 __Pyx_GOTREF(__pyx_t_5);
3187   - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3187 + __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3188 3188 __Pyx_GOTREF(__pyx_t_3);
3189 3189 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3190   - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__REQUEST_METHOD), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3190 + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__REQUEST_METHOD), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3191 3191 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3192 3192
3193   - /* "http_parser/parser.pyx":302
  3193 + /* "http_parser/parser.pyx":303
3194 3194 * environ.update({
3195 3195 * 'REQUEST_METHOD': self.get_method(),
3196 3196 * 'SERVER_PROTOCOL': "HTTP/%s" % ".".join(map(str, # <<<<<<<<<<<<<<
3197 3197 * self.get_version()))})
3198 3198 * return environ
3199 3199 */
3200   - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_17), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3200 + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_17), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3201 3201 __Pyx_GOTREF(__pyx_t_3);
3202 3202
3203   - /* "http_parser/parser.pyx":303
  3203 + /* "http_parser/parser.pyx":304
3204 3204 * 'REQUEST_METHOD': self.get_method(),
3205 3205 * 'SERVER_PROTOCOL': "HTTP/%s" % ".".join(map(str,
3206 3206 * self.get_version()))}) # <<<<<<<<<<<<<<
3207 3207 * return environ
3208 3208 *
3209 3209 */
3210   - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_version); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3210 + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_version); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3211 3211 __Pyx_GOTREF(__pyx_t_5);
3212   - __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3212 + __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3213 3213 __Pyx_GOTREF(__pyx_t_7);
3214 3214 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3215   - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3215 + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3216 3216 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
3217 3217 __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
3218 3218 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
@@ -3220,35 +3220,35 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
3220 3220 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
3221 3221 __Pyx_GIVEREF(__pyx_t_7);
3222 3222 __pyx_t_7 = 0;
3223   - __pyx_t_7 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3223 + __pyx_t_7 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3224 3224 __Pyx_GOTREF(__pyx_t_7);
3225 3225 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3226   - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3226 + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3227 3227 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
3228 3228 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
3229 3229 __Pyx_GIVEREF(__pyx_t_7);
3230 3230 __pyx_t_7 = 0;
3231   - __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3231 + __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3232 3232 __Pyx_GOTREF(__pyx_t_7);
3233 3233 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3234 3234 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3235   - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3235 + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3236 3236 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
3237 3237 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3238   - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__SERVER_PROTOCOL), ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3238 + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__SERVER_PROTOCOL), ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3239 3239 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3240   - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3240 + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3241 3241 __Pyx_GOTREF(((PyObject *)__pyx_t_5));
3242 3242 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
3243 3243 __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
3244 3244 __pyx_t_6 = 0;
3245   - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3245 + __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3246 3246 __Pyx_GOTREF(__pyx_t_6);
3247 3247 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3248 3248 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3249 3249 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3250 3250
3251   - /* "http_parser/parser.pyx":304
  3251 + /* "http_parser/parser.pyx":305
3252 3252 * 'SERVER_PROTOCOL': "HTTP/%s" % ".".join(map(str,
3253 3253 * self.get_version()))})
3254 3254 * return environ # <<<<<<<<<<<<<<
@@ -3281,7 +3281,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
3281 3281 return __pyx_r;
3282 3282 }
3283 3283
3284   -/* "http_parser/parser.pyx":306
  3284 +/* "http_parser/parser.pyx":307
3285 3285 * return environ
3286 3286 *
3287 3287 * def recv_body(self): # <<<<<<<<<<<<<<
@@ -3300,23 +3300,23 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_11recv_body(PyObjec
3300 3300 __Pyx_RefNannySetupContext("recv_body");
3301 3301 __pyx_v_body = Py_None; __Pyx_INCREF(Py_None);
3302 3302
3303   - /* "http_parser/parser.pyx":308
  3303 + /* "http_parser/parser.pyx":309
3304 3304 * def recv_body(self):
3305 3305 * """ return last chunk of the parsed body"""
3306 3306 * body = "".join(self._data.body) # <<<<<<<<<<<<<<
3307 3307 * self._data.body = []
3308 3308 * self._data.partial_body = False
3309 3309 */
3310   - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3310 + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3311 3311 __Pyx_GOTREF(__pyx_t_1);
3312   - __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3312 + __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3313 3313 __Pyx_GOTREF(__pyx_t_2);
3314   - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3314 + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3315 3315 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
3316 3316 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3317 3317 __Pyx_GIVEREF(__pyx_t_2);
3318 3318 __pyx_t_2 = 0;
3319   - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3319 + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3320 3320 __Pyx_GOTREF(__pyx_t_2);
3321 3321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3322 3322 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
@@ -3324,31 +3324,31 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_11recv_body(PyObjec
3324 3324 __pyx_v_body = __pyx_t_2;
3325 3325 __pyx_t_2 = 0;
3326 3326
3327   - /* "http_parser/parser.pyx":309
  3327 + /* "http_parser/parser.pyx":310
3328 3328 * """ return last chunk of the parsed body"""
3329 3329 * body = "".join(self._data.body)
3330 3330 * self._data.body = [] # <<<<<<<<<<<<<<
3331 3331 * self._data.partial_body = False
3332 3332 * return body
3333 3333 */
3334   - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3334 + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3335 3335 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
3336   - if (PyObject_SetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3336 + if (PyObject_SetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3337 3337 __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
3338 3338
3339   - /* "http_parser/parser.pyx":310
  3339 + /* "http_parser/parser.pyx":311
3340 3340 * body = "".join(self._data.body)
3341 3341 * self._data.body = []
3342 3342 * self._data.partial_body = False # <<<<<<<<<<<<<<
3343 3343 * return body
3344 3344 *
3345 3345 */
3346   - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3346 + __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3347 3347 __Pyx_GOTREF(__pyx_t_2);
3348   - if (PyObject_SetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__partial_body, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3348 + if (PyObject_SetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__partial_body, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3349 3349 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3350 3350
3351   - /* "http_parser/parser.pyx":311
  3351 + /* "http_parser/parser.pyx":312
3352 3352 * self._data.body = []
3353 3353 * self._data.partial_body = False
3354 3354 * return body # <<<<<<<<<<<<<<
@@ -3375,7 +3375,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_11recv_body(PyObjec
3375 3375 return __pyx_r;
3376 3376 }
3377 3377
3378   -/* "http_parser/parser.pyx":313
  3378 +/* "http_parser/parser.pyx":314
3379 3379 * return body
3380 3380 *
3381 3381 * def recv_body_into(self, b): # <<<<<<<<<<<<<<
@@ -3405,7 +3405,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
3405 3405 __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
3406 3406 __pyx_v_rest = Py_None; __Pyx_INCREF(Py_None);
3407 3407
3408   - /* "http_parser/parser.pyx":316
  3408 + /* "http_parser/parser.pyx":317
3409 3409 * """ Receive the last chunk of the parsed bodyand store the data
3410 3410 * in a buffer rather than creating a new string. """
3411 3411 * l = len(b) # <<<<<<<<<<<<<<
@@ -3414,27 +3414,27 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
3414 3414 */
3415 3415 __pyx_t_1 = __pyx_v_b;
3416 3416 __Pyx_INCREF(__pyx_t_1);
3417   - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3417 + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3418 3418 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3419 3419 __pyx_v_l = __pyx_t_2;
3420 3420
3421   - /* "http_parser/parser.pyx":317
  3421 + /* "http_parser/parser.pyx":318
3422 3422 * in a buffer rather than creating a new string. """
3423 3423 * l = len(b)
3424 3424 * body = "".join(self._data.body) # <<<<<<<<<<<<<<
3425 3425 * m = min(len(body), l)
3426 3426 * data, rest = body[:m], body[m:]
3427 3427 */
3428   - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3428 + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3429 3429 __Pyx_GOTREF(__pyx_t_1);
3430   - __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3430 + __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3431 3431 __Pyx_GOTREF(__pyx_t_3);
3432   - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3432 + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3433 3433 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
3434 3434 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
3435 3435 __Pyx_GIVEREF(__pyx_t_3);
3436 3436 __pyx_t_3 = 0;
3437   - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3437 + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3438 3438 __Pyx_GOTREF(__pyx_t_3);
3439 3439 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3440 3440 __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -3442,7 +3442,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
3442 3442 __pyx_v_body = __pyx_t_3;
3443 3443 __pyx_t_3 = 0;
3444 3444
3445   - /* "http_parser/parser.pyx":318
  3445 + /* "http_parser/parser.pyx":319
3446 3446 * l = len(b)
3447 3447 * body = "".join(self._data.body)
3448 3448 * m = min(len(body), l) # <<<<<<<<<<<<<<
@@ -3450,7 +3450,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
3450 3450 * b[0:m] = data
3451 3451 */
3452 3452 __pyx_t_2 = __pyx_v_l;
3453   - __pyx_t_5 = PyObject_Length(__pyx_v_body); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3453 + __pyx_t_5 = PyObject_Length(__pyx_v_body); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3454 3454 if ((__pyx_t_2 < __pyx_t_5)) {
3455 3455 __pyx_t_6 = __pyx_t_2;
3456 3456 } else {
@@ -3458,16 +3458,16 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
3458 3458 }
3459 3459 __pyx_v_m = __pyx_t_6;
3460 3460
3461   - /* "http_parser/parser.pyx":319
  3461 + /* "http_parser/parser.pyx":320
3462 3462 * body = "".join(self._data.body)
3463 3463 * m = min(len(body), l)
3464 3464 * data, rest = body[:m], body[m:] # <<<<<<<<<<<<<<
3465 3465 * b[0:m] = data
3466 3466 * if not rest:
3467 3467 */
3468   - __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_body, 0, __pyx_v_m); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3468 + __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_body, 0, __pyx_v_m); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3469 3469 __Pyx_GOTREF(__pyx_t_3);
3470   - __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_body, __pyx_v_m, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3470 + __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_body, __pyx_v_m, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3471 3471 __Pyx_GOTREF(__pyx_t_4);
3472 3472 __Pyx_DECREF(__pyx_v_data);
3473 3473 __pyx_v_data = __pyx_t_3;
@@ -3476,71 +3476,71 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
3476 3476 __pyx_v_rest = __pyx_t_4;
3477 3477 __pyx_t_4 = 0;
3478 3478
3479   - /* "http_parser/parser.pyx":320
  3479 + /* "http_parser/parser.pyx":321
3480 3480 * m = min(len(body), l)
3481 3481 * data, rest = body[:m], body[m:]
3482 3482 * b[0:m] = data # <<<<<<<<<<<<<<
3483 3483 * if not rest:
3484 3484 * self._data.body = []
3485 3485 */
3486   - if (__Pyx_PySequence_SetSlice(__pyx_v_b, 0, __pyx_v_m, __pyx_v_data) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3486 + if (__Pyx_PySequence_SetSlice(__pyx_v_b, 0, __pyx_v_m, __pyx_v_data) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3487 3487
3488   - /* "http_parser/parser.pyx":321
  3488 + /* "http_parser/parser.pyx":322
3489 3489 * data, rest = body[:m], body[m:]
3490 3490 * b[0:m] = data
3491 3491 * if not rest: # <<<<<<<<<<<<<<
3492 3492 * self._data.body = []
3493 3493 * self._data.partial_body = False
3494 3494 */
3495   - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_rest); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3495 + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_rest); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3496 3496 __pyx_t_8 = (!__pyx_t_7);
3497 3497 if (__pyx_t_8) {
3498 3498
3499   - /* "http_parser/parser.pyx":322
  3499 + /* "http_parser/parser.pyx":323
3500 3500 * b[0:m] = data
3501 3501 * if not rest:
3502 3502 * self._data.body = [] # <<<<<<<<<<<<<<
3503 3503 * self._data.partial_body = False
3504 3504 * else:
3505 3505 */
3506   - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3506 + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3507 3507 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
3508   - if (PyObject_SetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3508 + if (PyObject_SetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3509 3509 __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
3510 3510
3511   - /* "http_parser/parser.pyx":323
  3511 + /* "http_parser/parser.pyx":324
3512 3512 * if not rest:
3513 3513 * self._data.body = []
3514 3514 * self._data.partial_body = False # <<<<<<<<<<<<<<
3515 3515 * else:
3516 3516 * self._data.body = [rest]
3517 3517 */
3518   - __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3518 + __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3519 3519 __Pyx_GOTREF(__pyx_t_4);
3520   - if (PyObject_SetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__partial_body, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3520 + if (PyObject_SetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__partial_body, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3521 3521 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3522 3522 goto __pyx_L5;
3523 3523 }
3524 3524 /*else*/ {
3525 3525
3526   - /* "http_parser/parser.pyx":325
  3526 + /* "http_parser/parser.pyx":326
3527 3527 * self._data.partial_body = False
3528 3528 * else:
3529 3529 * self._data.body = [rest] # <<<<<<<<<<<<<<
3530 3530 * return m
3531 3531 *
3532 3532 */
3533   - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3533 + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3534 3534 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
3535 3535 __Pyx_INCREF(__pyx_v_rest);
3536 3536 PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_rest);
3537 3537 __Pyx_GIVEREF(__pyx_v_rest);
3538   - if (PyObject_SetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3538 + if (PyObject_SetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3539 3539 __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
3540 3540 }
3541 3541 __pyx_L5:;
3542 3542
3543   - /* "http_parser/parser.pyx":326
  3543 + /* "http_parser/parser.pyx":327
3544 3544 * else:
3545 3545 * self._data.body = [rest]
3546 3546 * return m # <<<<<<<<<<<<<<
@@ -3548,7 +3548,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
3548 3548 * def is_upgrade(self):
3549 3549 */
3550 3550 __Pyx_XDECREF(__pyx_r);
3551   - __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3551 + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3552 3552 __Pyx_GOTREF(__pyx_t_4);
3553 3553 __pyx_r = __pyx_t_4;
3554 3554 __pyx_t_4 = 0;
@@ -3571,7 +3571,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
3571 3571 return __pyx_r;
3572 3572 }
3573 3573
3574   -/* "http_parser/parser.pyx":328
  3574 +/* "http_parser/parser.pyx":329
3575 3575 * return m
3576 3576 *
3577 3577 * def is_upgrade(self): # <<<<<<<<<<<<<<
@@ -3586,7 +3586,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_13is_upgrade(PyObje
3586 3586 PyObject *__pyx_t_1 = NULL;
3587 3587 __Pyx_RefNannySetupContext("is_upgrade");
3588 3588
3589   - /* "http_parser/parser.pyx":331
  3589 + /* "http_parser/parser.pyx":332
3590 3590 * """ Do we get upgrade header in the request. Useful for
3591 3591 * websockets """
3592 3592 * return self._parser_upgrade # <<<<<<<<<<<<<<
@@ -3594,7 +3594,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_13is_upgrade(PyObje
3594 3594 * def is_headers_complete(self):
3595 3595 */
3596 3596 __Pyx_XDECREF(__pyx_r);
3597   - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___parser_upgrade); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3597 + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___parser_upgrade); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3598 3598 __Pyx_GOTREF(__pyx_t_1);
3599 3599 __pyx_r = __pyx_t_1;
3600 3600 __pyx_t_1 = 0;
@@ -3612,7 +3612,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_13is_upgrade(PyObje
3612 3612 return __pyx_r;
3613 3613 }
3614 3614
3615   -/* "http_parser/parser.pyx":333
  3615 +/* "http_parser/parser.pyx":334
3616 3616 * return self._parser_upgrade
3617 3617 *
3618 3618 * def is_headers_complete(self): # <<<<<<<<<<<<<<
@@ -3627,7 +3627,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_14is_headers_comple
3627 3627 PyObject *__pyx_t_1 = NULL;
3628 3628 __Pyx_RefNannySetupContext("is_headers_complete");
3629 3629
3630   - /* "http_parser/parser.pyx":335
  3630 + /* "http_parser/parser.pyx":336
3631 3631 * def is_headers_complete(self):
3632 3632 * """ return True if all headers have been parsed. """
3633 3633 * return self._data.headers_complete # <<<<<<<<<<<<<<
@@ -3635,7 +3635,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_14is_headers_comple
3635 3635 * def is_partial_body(self):
3636 3636 */
3637 3637 __Pyx_XDECREF(__pyx_r);
3638   - __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__headers_complete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3638 + __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__headers_complete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3639 3639 __Pyx_GOTREF(__pyx_t_1);
3640 3640 __pyx_r = __pyx_t_1;
3641 3641 __pyx_t_1 = 0;
@@ -3653,7 +3653,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_14is_headers_comple
3653 3653 return __pyx_r;
3654 3654 }
3655 3655
3656   -/* "http_parser/parser.pyx":337
  3656 +/* "http_parser/parser.pyx":338
3657 3657 * return self._data.headers_complete
3658 3658 *
3659 3659 * def is_partial_body(self): # <<<<<<<<<<<<<<
@@ -3668,7 +3668,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_15is_partial_body(P
3668 3668 PyObject *__pyx_t_1 = NULL;
3669 3669 __Pyx_RefNannySetupContext("is_partial_body");
3670 3670
3671   - /* "http_parser/parser.pyx":339
  3671 + /* "http_parser/parser.pyx":340
3672 3672 * def is_partial_body(self):
3673 3673 * """ return True if a chunk of body have been parsed """
3674 3674 * return self._data.partial_body # <<<<<<<<<<<<<<
@@ -3676,7 +3676,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_15is_partial_body(P
3676 3676 * def is_message_begin(self):
3677 3677 */
3678 3678 __Pyx_XDECREF(__pyx_r);
3679   - __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__partial_body); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3679 + __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__partial_body); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3680 3680 __Pyx_GOTREF(__pyx_t_1);
3681 3681 __pyx_r = __pyx_t_1;
3682 3682 __pyx_t_1 = 0;
@@ -3694,7 +3694,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_15is_partial_body(P
3694 3694 return __pyx_r;
3695 3695 }
3696 3696
3697   -/* "http_parser/parser.pyx":341
  3697 +/* "http_parser/parser.pyx":342
3698 3698 * return self._data.partial_body
3699 3699 *
3700 3700 * def is_message_begin(self): # <<<<<<<<<<<<<<
@@ -3709,7 +3709,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_16is_message_begin(
3709 3709 PyObject *__pyx_t_1 = NULL;
3710 3710 __Pyx_RefNannySetupContext("is_message_begin");
3711 3711
3712   - /* "http_parser/parser.pyx":343
  3712 + /* "http_parser/parser.pyx":344
3713 3713 * def is_message_begin(self):
3714 3714 * """ return True if the parsing start """
3715 3715 * return self._data.message_begin # <<<<<<<<<<<<<<
@@ -3717,7 +3717,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_16is_message_begin(
3717 3717 * def is_message_complete(self):
3718 3718 */
3719 3719 __Pyx_XDECREF(__pyx_r);
3720   - __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__message_begin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3720 + __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__message_begin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3721 3721 __Pyx_GOTREF(__pyx_t_1);
3722 3722 __pyx_r = __pyx_t_1;
3723 3723 __pyx_t_1 = 0;
@@ -3735,7 +3735,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_16is_message_begin(
3735 3735 return __pyx_r;
3736 3736 }
3737 3737
3738   -/* "http_parser/parser.pyx":345
  3738 +/* "http_parser/parser.pyx":346
3739 3739 * return self._data.message_begin
3740 3740 *
3741 3741 * def is_message_complete(self): # <<<<<<<<<<<<<<
@@ -3750,7 +3750,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_17is_message_comple
3750 3750 PyObject *__pyx_t_1 = NULL;
3751 3751 __Pyx_RefNannySetupContext("is_message_complete");
3752 3752
3753   - /* "http_parser/parser.pyx":347
  3753 + /* "http_parser/parser.pyx":348
3754 3754 * def is_message_complete(self):
3755 3755 * """ return True if the parsing is done (we get EOF) """
3756 3756 * return self._data.message_complete # <<<<<<<<<<<<<<
@@ -3758,7 +3758,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_17is_message_comple
3758 3758 * def should_keep_alive(self):
3759 3759 */
3760 3760 __Pyx_XDECREF(__pyx_r);
3761   - __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__message_complete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3761 + __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__message_complete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3762 3762 __Pyx_GOTREF(__pyx_t_1);
3763 3763 __pyx_r = __pyx_t_1;
3764 3764 __pyx_t_1 = 0;
@@ -3776,7 +3776,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_17is_message_comple
3776 3776 return __pyx_r;
3777 3777 }
3778 3778
3779   -/* "http_parser/parser.pyx":349
  3779 +/* "http_parser/parser.pyx":350
3780 3780 * return self._data.message_complete
3781 3781 *
3782 3782 * def should_keep_alive(self): # <<<<<<<<<<<<<<
@@ -3791,13 +3791,13 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_18should_keep_alive
3791 3791 PyObject *__pyx_t_1 = NULL;
3792 3792 __Pyx_RefNannySetupContext("should_keep_alive");
3793 3793
3794   - /* "http_parser/parser.pyx":352
  3794 + /* "http_parser/parser.pyx":353
3795 3795 * """ return True if the connection should be kept alive
3796 3796 * """
3797 3797 * return http_should_keep_alive(&self._parser) # <<<<<<<<<<<<<<
3798 3798 */
3799 3799 __Pyx_XDECREF(__pyx_r);
3800   - __pyx_t_1 = PyInt_FromLong(http_should_keep_alive((&((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_parser))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3800 + __pyx_t_1 = PyInt_FromLong(http_should_keep_alive((&((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_parser))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3801 3801 __Pyx_GOTREF(__pyx_t_1);
3802 3802 __pyx_r = __pyx_t_1;
3803 3803 __pyx_t_1 = 0;
@@ -4134,7 +4134,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
4134 4134 };
4135 4135 static int __Pyx_InitCachedBuiltins(void) {
4136 4136 __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4137   - __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4137 + __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4138 4138 return 0;
4139 4139 __pyx_L1_error:;
4140 4140 return -1;
@@ -4174,14 +4174,14 @@ static int __Pyx_InitCachedConstants(void) {
4174 4174 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
4175 4175 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
4176 4176
4177   - /* "http_parser/parser.pyx":277
  4177 + /* "http_parser/parser.pyx":278
4178 4178 *
4179 4179 * # clean special keys
4180 4180 * for key in ("CONTENT_LENGTH", "CONTENT_TYPE", "SCRIPT_NAME"): # <<<<<<<<<<<<<<
4181 4181 * hkey = "HTTP_%s" % key
4182 4182 * if hkey in environ:
4183 4183 */
4184   - __pyx_k_tuple_9 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4184 + __pyx_k_tuple_9 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4185 4185 __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9));
4186 4186 __Pyx_INCREF(((PyObject *)__pyx_n_s__CONTENT_LENGTH));
4187 4187 PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_n_s__CONTENT_LENGTH));
@@ -4194,14 +4194,14 @@ static int __Pyx_InitCachedConstants(void) {
4194 4194 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SCRIPT_NAME));
4195 4195 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));
4196 4196
4197   - /* "http_parser/parser.pyx":283
  4197 + /* "http_parser/parser.pyx":284
4198 4198 *
4199 4199 * script_name = environ.get('HTTP_SCRIPT_NAME',
4200 4200 * os.environ.get("SCRIPT_NAME", "")) # <<<<<<<<<<<<<<
4201 4201 *
4202 4202 * if script_name:
4203 4203 */
4204   - __pyx_k_tuple_10 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4204 + __pyx_k_tuple_10 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4205 4205 __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_10));
4206 4206 __Pyx_INCREF(((PyObject *)__pyx_n_s__SCRIPT_NAME));
4207 4207 PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_n_s__SCRIPT_NAME));
@@ -4211,14 +4211,14 @@ static int __Pyx_InitCachedConstants(void) {
4211 4211 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
4212 4212 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
4213 4213
4214   - /* "http_parser/parser.pyx":292
  4214 + /* "http_parser/parser.pyx":293
4215 4215 * 'SCRIPT_NAME': script_name})
4216 4216 *
4217 4217 * if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl": # <<<<<<<<<<<<<<
4218 4218 * environ['wsgi.url_scheme']= "https"
4219 4219 * elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on":
4220 4220 */
4221   - __pyx_k_tuple_12 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4221 + __pyx_k_tuple_12 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4222 4222 __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12));
4223 4223 __Pyx_INCREF(((PyObject *)__pyx_n_s_11));
4224 4224 PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_n_s_11));
@@ -4228,14 +4228,14 @@ static int __Pyx_InitCachedConstants(void) {
4228 4228 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
4229 4229 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));
4230 4230
4231   - /* "http_parser/parser.pyx":294
  4231 + /* "http_parser/parser.pyx":295
4232 4232 * if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl":
4233 4233 * environ['wsgi.url_scheme']= "https"
4234 4234 * elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on": # <<<<<<<<<<<<<<
4235 4235 * environ['wsgi.url_scheme'] = "https"
4236 4236 * else:
4237 4237 */
4238   - __pyx_k_tuple_15 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4238 + __pyx_k_tuple_15 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4239 4239 __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15));
4240 4240 __Pyx_INCREF(((PyObject *)__pyx_n_s_14));
4241 4241 PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_n_s_14));
3  http_parser/parser.pyx
@@ -266,7 +266,8 @@ cdef class HttpParser:
266 266 return self._data.fragment
267 267
268 268 def get_headers(self):
269   - """ get request/response headers """
  269 + """ get request/response headers, headers are returned in a
  270 + OrderedDict that allows you to get value using insensitive keys. """
270 271 return self._data.headers
271 272
272 273 def get_wsgi_environ(self):
62 http_parser/util.py
@@ -174,3 +174,65 @@ def __eq__(self, other):
174 174 def __del__(self):
175 175 self.clear() # eliminate cyclical references
176 176
  177 +
  178 +status_reasons = {
  179 + # Status Codes
  180 + # Informational
  181 + 100: 'Continue',
  182 + 101: 'Switching Protocols',
  183 + 102: 'Processing',
  184 +
  185 + # Successful
  186 + 200: 'OK',
  187 + 201: 'Created',
  188 + 202: 'Accepted',
  189 + 203: 'Non Authoritative Information',
  190 + 204: 'No Content',
  191 + 205: 'Reset Content',
  192 + 206: 'Partial Content',
  193 + 207: 'Multi Status',
  194 + 226: 'IM Used',
  195 +
  196 + # Redirection
  197 + 300: 'Multiple Choices',
  198 + 301: 'Moved Permanently',
  199 + 302: 'Found',
  200 + 303: 'See Other',
  201 + 304: 'Not Modified',
  202 + 305: 'Use Proxy',
  203 + 307: 'Temporary Redirect',
  204 +
  205 + # Client Error
  206 + 400: 'Bad Request',
  207 + 401: 'Unauthorized',
  208 + 402: 'Payment Required',
  209 + 403: 'Forbidden',
  210 + 404: 'Not Found',
  211 + 405: 'Method Not Allowed',
  212 + 406: 'Not Acceptable',
  213 + 407: 'Proxy Authentication Required',
  214 + 408: 'Request Timeout',
  215 + 409: 'Conflict',
  216 + 410: 'Gone',
  217 + 411: 'Length Required',