Permalink
Browse files

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...
1 parent 33d3529 commit 81e3c659a6bfe9bfa13883fff6ec23f9bb21d5ee @benoitc committed May 3, 2011
Showing with 234 additions and 161 deletions.
  1. +1 −1 http_parser/__init__.py
  2. +11 −1 http_parser/http.py
  3. +158 −158 http_parser/parser.c
  4. +2 −1 http_parser/parser.pyx
  5. +62 −0 http_parser/util.py
View
2 http_parser/__init__.py
@@ -3,5 +3,5 @@
# This file is part of http_parser released under the MIT license.
# See the NOTICE for more information.
-version_info = (0, 2, 1)
+version_info = (0, 3, 0)
__version__ = ".".join(map(str, version_info))
View
12 http_parser/http.py
@@ -7,6 +7,7 @@
from .parser import HttpParser
from .reader import HttpBodyReader
+from .util import status_reasons
HTTP_BOTH = 2
HTTP_RESPONSE = 1
@@ -77,13 +78,22 @@ def status_code(self):
self._check_headers_complete()
return self.parser.get_status_code()
+ def status(self):
+ """ return complete status with reason """
+ status_code = self.status_code()
+ reason = status_reasons.get(int(status_code), 'unknown')
+ return "%s %s" % (status_code, reason)
+
+
def method(self):
""" get HTTP method as string"""
self._check_headers_complete()
return self.parser.get_method()
def headers(self):
- """ get request/response headers """
+ """ get request/response headers, headers are returned in a
+ OrderedDict that allows you to get value using insensitive
+ keys."""
self._check_headers_complete()
return self.parser.get_headers()
View
316 http_parser/parser.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.14.1 on Tue May 3 20:57:00 2011 */
+/* Generated by Cython 0.14.1 on Tue May 3 21:12:15 2011 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -2793,26 +2793,26 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_8get_fragment(PyObj
* return self._data.fragment
*
* def get_headers(self): # <<<<<<<<<<<<<<
- * """ get request/response headers """
- * return self._data.headers
+ * """ get request/response headers, headers are returned in a
+ * OrderedDict that allows you to get value using insensitive keys. """
*/
static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_9get_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_11http_parser_6parser_10HttpParser_9get_headers[] = " get request/response headers ";
+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. ";
static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_9get_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("get_headers");
- /* "http_parser/parser.pyx":270
- * def get_headers(self):
- * """ get request/response headers """
+ /* "http_parser/parser.pyx":271
+ * """ get request/response headers, headers are returned in a
+ * OrderedDict that allows you to get value using insensitive keys. """
* return self._data.headers # <<<<<<<<<<<<<<
*
* def get_wsgi_environ(self):
*/
__Pyx_XDECREF(__pyx_r);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -2830,7 +2830,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_9get_headers(PyObje
return __pyx_r;
}
-/* "http_parser/parser.pyx":272
+/* "http_parser/parser.pyx":273
* return self._data.headers
*
* def get_wsgi_environ(self): # <<<<<<<<<<<<<<
@@ -2861,20 +2861,20 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
__pyx_v_script_name = Py_None; __Pyx_INCREF(Py_None);
__pyx_v_path_info = Py_None; __Pyx_INCREF(Py_None);
- /* "http_parser/parser.pyx":274
+ /* "http_parser/parser.pyx":275
* def get_wsgi_environ(self):
* """ get WSGI environ based on the current request """
* environ = self._data.environ # <<<<<<<<<<<<<<
*
* # clean special keys
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_environ);
__pyx_v_environ = __pyx_t_1;
__pyx_t_1 = 0;
- /* "http_parser/parser.pyx":277
+ /* "http_parser/parser.pyx":278
*
* # clean special keys
* for key in ("CONTENT_LENGTH", "CONTENT_TYPE", "SCRIPT_NAME"): # <<<<<<<<<<<<<<
@@ -2889,188 +2889,188 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
__pyx_v_key = __pyx_t_3;
__pyx_t_3 = 0;
- /* "http_parser/parser.pyx":278
+ /* "http_parser/parser.pyx":279
* # clean special keys
* for key in ("CONTENT_LENGTH", "CONTENT_TYPE", "SCRIPT_NAME"):
* hkey = "HTTP_%s" % key # <<<<<<<<<<<<<<
* if hkey in environ:
* environ[key] = environ.pop(hkey)
*/
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
__Pyx_DECREF(__pyx_v_hkey);
__pyx_v_hkey = ((PyObject *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "http_parser/parser.pyx":279
+ /* "http_parser/parser.pyx":280
* for key in ("CONTENT_LENGTH", "CONTENT_TYPE", "SCRIPT_NAME"):
* hkey = "HTTP_%s" % key
* if hkey in environ: # <<<<<<<<<<<<<<
* environ[key] = environ.pop(hkey)
*
*/
- __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;}
+ __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;}
if (__pyx_t_4) {
- /* "http_parser/parser.pyx":280
+ /* "http_parser/parser.pyx":281
* hkey = "HTTP_%s" % key
* if hkey in environ:
* environ[key] = environ.pop(hkey) # <<<<<<<<<<<<<<
*
* script_name = environ.get('HTTP_SCRIPT_NAME',
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_3);
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__Pyx_INCREF(__pyx_v_hkey);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_hkey);
__Pyx_GIVEREF(__pyx_v_hkey);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- 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;}
+ 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;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L7;
}
__pyx_L7:;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "http_parser/parser.pyx":282
+ /* "http_parser/parser.pyx":283
* environ[key] = environ.pop(hkey)
*
* script_name = environ.get('HTTP_SCRIPT_NAME', # <<<<<<<<<<<<<<
* os.environ.get("SCRIPT_NAME", ""))
*
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
- /* "http_parser/parser.pyx":283
+ /* "http_parser/parser.pyx":284
*
* script_name = environ.get('HTTP_SCRIPT_NAME',
* os.environ.get("SCRIPT_NAME", "")) # <<<<<<<<<<<<<<
*
* if script_name:
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_6);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
__Pyx_INCREF(((PyObject *)__pyx_n_s__HTTP_SCRIPT_NAME));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__HTTP_SCRIPT_NAME));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__HTTP_SCRIPT_NAME));
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_v_script_name);
__pyx_v_script_name = __pyx_t_5;
__pyx_t_5 = 0;
- /* "http_parser/parser.pyx":285
+ /* "http_parser/parser.pyx":286
* os.environ.get("SCRIPT_NAME", ""))
*
* if script_name: # <<<<<<<<<<<<<<
* path_info = self.get_path()
* path_info = path_info.split(script_name, 1)[1]
*/
- __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;}
+ __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;}
if (__pyx_t_4) {
- /* "http_parser/parser.pyx":286
+ /* "http_parser/parser.pyx":287
*
* if script_name:
* path_info = self.get_path() # <<<<<<<<<<<<<<
* path_info = path_info.split(script_name, 1)[1]
* environ.update({
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_5);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_v_path_info);
__pyx_v_path_info = __pyx_t_6;
__pyx_t_6 = 0;
- /* "http_parser/parser.pyx":287
+ /* "http_parser/parser.pyx":288
* if script_name:
* path_info = self.get_path()
* path_info = path_info.split(script_name, 1)[1] # <<<<<<<<<<<<<<
* environ.update({
* 'PATH_INFO': path_info,
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_6);
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__Pyx_INCREF(__pyx_v_script_name);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_script_name);
__Pyx_GIVEREF(__pyx_v_script_name);
__Pyx_INCREF(__pyx_int_1);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_1);
__Pyx_GIVEREF(__pyx_int_1);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_v_path_info);
__pyx_v_path_info = __pyx_t_5;
__pyx_t_5 = 0;
- /* "http_parser/parser.pyx":288
+ /* "http_parser/parser.pyx":289
* path_info = self.get_path()
* path_info = path_info.split(script_name, 1)[1]
* environ.update({ # <<<<<<<<<<<<<<
* 'PATH_INFO': path_info,
* 'SCRIPT_NAME': script_name})
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_5);
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- /* "http_parser/parser.pyx":289
+ /* "http_parser/parser.pyx":290
* path_info = path_info.split(script_name, 1)[1]
* environ.update({
* 'PATH_INFO': path_info, # <<<<<<<<<<<<<<
* 'SCRIPT_NAME': script_name})
*
*/
- 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;}
+ 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;}
- /* "http_parser/parser.pyx":290
+ /* "http_parser/parser.pyx":291
* environ.update({
* 'PATH_INFO': path_info,
* 'SCRIPT_NAME': script_name}) # <<<<<<<<<<<<<<
*
* if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl":
*/
- 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;}
- __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;}
+ 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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_t_1 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
@@ -3079,176 +3079,176 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
}
__pyx_L8:;
- /* "http_parser/parser.pyx":292
+ /* "http_parser/parser.pyx":293
* 'SCRIPT_NAME': script_name})
*
* if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl": # <<<<<<<<<<<<<<
* environ['wsgi.url_scheme']= "https"
* elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on":
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __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;}
+ __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;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
- /* "http_parser/parser.pyx":293
+ /* "http_parser/parser.pyx":294
*
* if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl":
* environ['wsgi.url_scheme']= "https" # <<<<<<<<<<<<<<
* elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on":
* environ['wsgi.url_scheme'] = "https"
*/
- 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;}
+ 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;}
goto __pyx_L9;
}
- /* "http_parser/parser.pyx":294
+ /* "http_parser/parser.pyx":295
* if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl":
* environ['wsgi.url_scheme']= "https"
* elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on": # <<<<<<<<<<<<<<
* environ['wsgi.url_scheme'] = "https"
* else:
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __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;}
+ __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;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
- /* "http_parser/parser.pyx":295
+ /* "http_parser/parser.pyx":296
* environ['wsgi.url_scheme']= "https"
* elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on":
* environ['wsgi.url_scheme'] = "https" # <<<<<<<<<<<<<<
* else:
* environ['wsgi.url_scheme'] = "http"
*/
- 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;}
+ 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;}
goto __pyx_L9;
}
/*else*/ {
- /* "http_parser/parser.pyx":297
+ /* "http_parser/parser.pyx":298
* environ['wsgi.url_scheme'] = "https"
* else:
* environ['wsgi.url_scheme'] = "http" # <<<<<<<<<<<<<<
*
* # add missing environ var
*/
- 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;}
+ 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;}
}
__pyx_L9:;
- /* "http_parser/parser.pyx":300
+ /* "http_parser/parser.pyx":301
*
* # add missing environ var
* environ.update({ # <<<<<<<<<<<<<<
* 'REQUEST_METHOD': self.get_method(),
* 'SERVER_PROTOCOL': "HTTP/%s" % ".".join(map(str,
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
- /* "http_parser/parser.pyx":301
+ /* "http_parser/parser.pyx":302
* # add missing environ var
* environ.update({
* 'REQUEST_METHOD': self.get_method(), # <<<<<<<<<<<<<<
* 'SERVER_PROTOCOL': "HTTP/%s" % ".".join(map(str,
* self.get_version()))})
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_5);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- 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;}
+ 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;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "http_parser/parser.pyx":302
+ /* "http_parser/parser.pyx":303
* environ.update({
* 'REQUEST_METHOD': self.get_method(),
* 'SERVER_PROTOCOL': "HTTP/%s" % ".".join(map(str, # <<<<<<<<<<<<<<
* self.get_version()))})
* return environ
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_3);
- /* "http_parser/parser.pyx":303
+ /* "http_parser/parser.pyx":304
* 'REQUEST_METHOD': self.get_method(),
* 'SERVER_PROTOCOL': "HTTP/%s" % ".".join(map(str,
* self.get_version()))}) # <<<<<<<<<<<<<<
* return environ
*
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_5);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
__pyx_t_7 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
__pyx_t_7 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- 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;}
+ 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;}
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
__Pyx_GIVEREF(((PyObject *)__pyx_t_6));
__pyx_t_6 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "http_parser/parser.pyx":304
+ /* "http_parser/parser.pyx":305
* 'SERVER_PROTOCOL': "HTTP/%s" % ".".join(map(str,
* self.get_version()))})
* return environ # <<<<<<<<<<<<<<
@@ -3281,7 +3281,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_10get_wsgi_environ(
return __pyx_r;
}
-/* "http_parser/parser.pyx":306
+/* "http_parser/parser.pyx":307
* return environ
*
* def recv_body(self): # <<<<<<<<<<<<<<
@@ -3300,55 +3300,55 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_11recv_body(PyObjec
__Pyx_RefNannySetupContext("recv_body");
__pyx_v_body = Py_None; __Pyx_INCREF(Py_None);
- /* "http_parser/parser.pyx":308
+ /* "http_parser/parser.pyx":309
* def recv_body(self):
* """ return last chunk of the parsed body"""
* body = "".join(self._data.body) # <<<<<<<<<<<<<<
* self._data.body = []
* self._data.partial_body = False
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_2);
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_v_body);
__pyx_v_body = __pyx_t_2;
__pyx_t_2 = 0;
- /* "http_parser/parser.pyx":309
+ /* "http_parser/parser.pyx":310
* """ return last chunk of the parsed body"""
* body = "".join(self._data.body)
* self._data.body = [] # <<<<<<<<<<<<<<
* self._data.partial_body = False
* return body
*/
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- 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;}
+ 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;}
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- /* "http_parser/parser.pyx":310
+ /* "http_parser/parser.pyx":311
* body = "".join(self._data.body)
* self._data.body = []
* self._data.partial_body = False # <<<<<<<<<<<<<<
* return body
*
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_2);
- 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;}
+ 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;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "http_parser/parser.pyx":311
+ /* "http_parser/parser.pyx":312
* self._data.body = []
* self._data.partial_body = False
* return body # <<<<<<<<<<<<<<
@@ -3375,7 +3375,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_11recv_body(PyObjec
return __pyx_r;
}
-/* "http_parser/parser.pyx":313
+/* "http_parser/parser.pyx":314
* return body
*
* def recv_body_into(self, b): # <<<<<<<<<<<<<<
@@ -3405,7 +3405,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
__pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
__pyx_v_rest = Py_None; __Pyx_INCREF(Py_None);
- /* "http_parser/parser.pyx":316
+ /* "http_parser/parser.pyx":317
* """ Receive the last chunk of the parsed bodyand store the data
* in a buffer rather than creating a new string. """
* l = len(b) # <<<<<<<<<<<<<<
@@ -3414,60 +3414,60 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
*/
__pyx_t_1 = __pyx_v_b;
__Pyx_INCREF(__pyx_t_1);
- __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;}
+ __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;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_l = __pyx_t_2;
- /* "http_parser/parser.pyx":317
+ /* "http_parser/parser.pyx":318
* in a buffer rather than creating a new string. """
* l = len(b)
* body = "".join(self._data.body) # <<<<<<<<<<<<<<
* m = min(len(body), l)
* data, rest = body[:m], body[m:]
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_3);
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_v_body);
__pyx_v_body = __pyx_t_3;
__pyx_t_3 = 0;
- /* "http_parser/parser.pyx":318
+ /* "http_parser/parser.pyx":319
* l = len(b)
* body = "".join(self._data.body)
* m = min(len(body), l) # <<<<<<<<<<<<<<
* data, rest = body[:m], body[m:]
* b[0:m] = data
*/
__pyx_t_2 = __pyx_v_l;
- __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;}
+ __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;}
if ((__pyx_t_2 < __pyx_t_5)) {
__pyx_t_6 = __pyx_t_2;
} else {
__pyx_t_6 = __pyx_t_5;
}
__pyx_v_m = __pyx_t_6;
- /* "http_parser/parser.pyx":319
+ /* "http_parser/parser.pyx":320
* body = "".join(self._data.body)
* m = min(len(body), l)
* data, rest = body[:m], body[m:] # <<<<<<<<<<<<<<
* b[0:m] = data
* if not rest:
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_3);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_v_data);
__pyx_v_data = __pyx_t_3;
@@ -3476,79 +3476,79 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
__pyx_v_rest = __pyx_t_4;
__pyx_t_4 = 0;
- /* "http_parser/parser.pyx":320
+ /* "http_parser/parser.pyx":321
* m = min(len(body), l)
* data, rest = body[:m], body[m:]
* b[0:m] = data # <<<<<<<<<<<<<<
* if not rest:
* self._data.body = []
*/
- 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;}
+ 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;}
- /* "http_parser/parser.pyx":321
+ /* "http_parser/parser.pyx":322
* data, rest = body[:m], body[m:]
* b[0:m] = data
* if not rest: # <<<<<<<<<<<<<<
* self._data.body = []
* self._data.partial_body = False
*/
- __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;}
+ __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;}
__pyx_t_8 = (!__pyx_t_7);
if (__pyx_t_8) {
- /* "http_parser/parser.pyx":322
+ /* "http_parser/parser.pyx":323
* b[0:m] = data
* if not rest:
* self._data.body = [] # <<<<<<<<<<<<<<
* self._data.partial_body = False
* else:
*/
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
- 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;}
+ 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;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- /* "http_parser/parser.pyx":323
+ /* "http_parser/parser.pyx":324
* if not rest:
* self._data.body = []
* self._data.partial_body = False # <<<<<<<<<<<<<<
* else:
* self._data.body = [rest]
*/
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_4);
- 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;}
+ 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;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L5;
}
/*else*/ {
- /* "http_parser/parser.pyx":325
+ /* "http_parser/parser.pyx":326
* self._data.partial_body = False
* else:
* self._data.body = [rest] # <<<<<<<<<<<<<<
* return m
*
*/
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_INCREF(__pyx_v_rest);
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_rest);
__Pyx_GIVEREF(__pyx_v_rest);
- 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;}
+ 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;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
}
__pyx_L5:;
- /* "http_parser/parser.pyx":326
+ /* "http_parser/parser.pyx":327
* else:
* self._data.body = [rest]
* return m # <<<<<<<<<<<<<<
*
* def is_upgrade(self):
*/
__Pyx_XDECREF(__pyx_r);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
@@ -3571,7 +3571,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_12recv_body_into(Py
return __pyx_r;
}
-/* "http_parser/parser.pyx":328
+/* "http_parser/parser.pyx":329
* return m
*
* def is_upgrade(self): # <<<<<<<<<<<<<<
@@ -3586,15 +3586,15 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_13is_upgrade(PyObje
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("is_upgrade");
- /* "http_parser/parser.pyx":331
+ /* "http_parser/parser.pyx":332
* """ Do we get upgrade header in the request. Useful for
* websockets """
* return self._parser_upgrade # <<<<<<<<<<<<<<
*
* def is_headers_complete(self):
*/
__Pyx_XDECREF(__pyx_r);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -3612,7 +3612,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_13is_upgrade(PyObje
return __pyx_r;
}
-/* "http_parser/parser.pyx":333
+/* "http_parser/parser.pyx":334
* return self._parser_upgrade
*
* def is_headers_complete(self): # <<<<<<<<<<<<<<
@@ -3627,15 +3627,15 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_14is_headers_comple
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("is_headers_complete");
- /* "http_parser/parser.pyx":335
+ /* "http_parser/parser.pyx":336
* def is_headers_complete(self):
* """ return True if all headers have been parsed. """
* return self._data.headers_complete # <<<<<<<<<<<<<<
*
* def is_partial_body(self):
*/
__Pyx_XDECREF(__pyx_r);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -3653,7 +3653,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_14is_headers_comple
return __pyx_r;
}
-/* "http_parser/parser.pyx":337
+/* "http_parser/parser.pyx":338
* return self._data.headers_complete
*
* def is_partial_body(self): # <<<<<<<<<<<<<<
@@ -3668,15 +3668,15 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_15is_partial_body(P
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("is_partial_body");
- /* "http_parser/parser.pyx":339
+ /* "http_parser/parser.pyx":340
* def is_partial_body(self):
* """ return True if a chunk of body have been parsed """
* return self._data.partial_body # <<<<<<<<<<<<<<
*
* def is_message_begin(self):
*/
__Pyx_XDECREF(__pyx_r);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -3694,7 +3694,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_15is_partial_body(P
return __pyx_r;
}
-/* "http_parser/parser.pyx":341
+/* "http_parser/parser.pyx":342
* return self._data.partial_body
*
* def is_message_begin(self): # <<<<<<<<<<<<<<
@@ -3709,15 +3709,15 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_16is_message_begin(
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("is_message_begin");
- /* "http_parser/parser.pyx":343
+ /* "http_parser/parser.pyx":344
* def is_message_begin(self):
* """ return True if the parsing start """
* return self._data.message_begin # <<<<<<<<<<<<<<
*
* def is_message_complete(self):
*/
__Pyx_XDECREF(__pyx_r);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -3735,7 +3735,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_16is_message_begin(
return __pyx_r;
}
-/* "http_parser/parser.pyx":345
+/* "http_parser/parser.pyx":346
* return self._data.message_begin
*
* def is_message_complete(self): # <<<<<<<<<<<<<<
@@ -3750,15 +3750,15 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_17is_message_comple
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("is_message_complete");
- /* "http_parser/parser.pyx":347
+ /* "http_parser/parser.pyx":348
* def is_message_complete(self):
* """ return True if the parsing is done (we get EOF) """
* return self._data.message_complete # <<<<<<<<<<<<<<
*
* def should_keep_alive(self):
*/
__Pyx_XDECREF(__pyx_r);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -3776,7 +3776,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_17is_message_comple
return __pyx_r;
}
-/* "http_parser/parser.pyx":349
+/* "http_parser/parser.pyx":350
* return self._data.message_complete
*
* def should_keep_alive(self): # <<<<<<<<<<<<<<
@@ -3791,13 +3791,13 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_18should_keep_alive
PyObject *__pyx_t_1 = NULL;
__Pyx_RefNannySetupContext("should_keep_alive");
- /* "http_parser/parser.pyx":352
+ /* "http_parser/parser.pyx":353
* """ return True if the connection should be kept alive
* """
* return http_should_keep_alive(&self._parser) # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
- __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;}
+ __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;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -4134,7 +4134,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
};
static int __Pyx_InitCachedBuiltins(void) {
__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;}
- __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;}
+ __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;}
return 0;
__pyx_L1_error:;
return -1;
@@ -4174,14 +4174,14 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
- /* "http_parser/parser.pyx":277
+ /* "http_parser/parser.pyx":278
*
* # clean special keys
* for key in ("CONTENT_LENGTH", "CONTENT_TYPE", "SCRIPT_NAME"): # <<<<<<<<<<<<<<
* hkey = "HTTP_%s" % key
* if hkey in environ:
*/
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9));
__Pyx_INCREF(((PyObject *)__pyx_n_s__CONTENT_LENGTH));
PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_n_s__CONTENT_LENGTH));
@@ -4194,14 +4194,14 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__SCRIPT_NAME));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));
- /* "http_parser/parser.pyx":283
+ /* "http_parser/parser.pyx":284
*
* script_name = environ.get('HTTP_SCRIPT_NAME',
* os.environ.get("SCRIPT_NAME", "")) # <<<<<<<<<<<<<<
*
* if script_name:
*/
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_k_tuple_10));
__Pyx_INCREF(((PyObject *)__pyx_n_s__SCRIPT_NAME));
PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_n_s__SCRIPT_NAME));
@@ -4211,14 +4211,14 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
- /* "http_parser/parser.pyx":292
+ /* "http_parser/parser.pyx":293
* 'SCRIPT_NAME': script_name})
*
* if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl": # <<<<<<<<<<<<<<
* environ['wsgi.url_scheme']= "https"
* elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on":
*/
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12));
__Pyx_INCREF(((PyObject *)__pyx_n_s_11));
PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_n_s_11));
@@ -4228,14 +4228,14 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));
- /* "http_parser/parser.pyx":294
+ /* "http_parser/parser.pyx":295
* if environ.get('HTTP_X_FORWARDED_PROTOCOL', '').lower() == "ssl":
* environ['wsgi.url_scheme']= "https"
* elif environ.get('HTTP_X_FORWARDED_SSL', '').lower() == "on": # <<<<<<<<<<<<<<
* environ['wsgi.url_scheme'] = "https"
* else:
*/
- __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;}
+ __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;}
__Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15));
__Pyx_INCREF(((PyObject *)__pyx_n_s_14));
PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_n_s_14));
View
3 http_parser/parser.pyx
@@ -266,7 +266,8 @@ cdef class HttpParser:
return self._data.fragment
def get_headers(self):
- """ get request/response headers """
+ """ get request/response headers, headers are returned in a
+ OrderedDict that allows you to get value using insensitive keys. """
return self._data.headers
def get_wsgi_environ(self):
View
62 http_parser/util.py
@@ -174,3 +174,65 @@ def __eq__(self, other):
def __del__(self):
self.clear() # eliminate cyclical references
+
+status_reasons = {
+ # Status Codes
+ # Informational
+ 100: 'Continue',
+ 101: 'Switching Protocols',
+ 102: 'Processing',
+
+ # Successful
+ 200: 'OK',
+ 201: 'Created',
+ 202: 'Accepted',
+ 203: 'Non Authoritative Information',
+ 204: 'No Content',
+ 205: 'Reset Content',
+ 206: 'Partial Content',
+ 207: 'Multi Status',
+ 226: 'IM Used',
+
+ # Redirection
+ 300: 'Multiple Choices',
+ 301: 'Moved Permanently',
+ 302: 'Found',
+ 303: 'See Other',
+ 304: 'Not Modified',
+ 305: 'Use Proxy',
+ 307: 'Temporary Redirect',
+
+ # Client Error
+ 400: 'Bad Request',
+ 401: 'Unauthorized',
+ 402: 'Payment Required',
+ 403: 'Forbidden',
+ 404: 'Not Found',
+ 405: 'Method Not Allowed',
+ 406: 'Not Acceptable',
+ 407: 'Proxy Authentication Required',
+ 408: 'Request Timeout',
+ 409: 'Conflict',
+ 410: 'Gone',
+ 411: 'Length Required',
+ 412: 'Precondition Failed',
+ 413: 'Request Entity Too Large',
+ 414: 'Request URI Too Long',
+ 415: 'Unsupported Media Type',
+ 416: 'Requested Range Not Satisfiable',
+ 417: 'Expectation Failed',
+ 422: 'Unprocessable Entity',
+ 423: 'Locked',
+ 424: 'Failed Dependency',
+ 426: 'Upgrade Required',
+
+ # Server Error
+ 500: 'Internal Server Error',
+ 501: 'Not Implemented',
+ 502: 'Bad Gateway',
+ 503: 'Service Unavailable',
+ 504: 'Gateway Timeout',
+ 505: 'HTTP Version Not Supported',
+ 507: 'Insufficient Storage',
+ 510: 'Not Extended',
+}

0 comments on commit 81e3c65

Please sign in to comment.