Klaus Demo bjoern / 113bf91
Remove REQUEST_URI from the WSGI dict as it's not in the spec Jonas Haag 9 years ago
2 changed file(s) with 6 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
1414 HTTP_BAD_REQUEST = 1, HTTP_LENGTH_REQUIRED, HTTP_SERVER_ERROR
1515 } http_status;
1616
17 PyObject *_REMOTE_ADDR, *_PATH_INFO, *_QUERY_STRING, *_REQUEST_URI,
18 *_HTTP_FRAGMENT, *_REQUEST_METHOD, *_SERVER_PROTOCOL, *_GET,
19 *_Content_Length, *_Content_Type, *_Connection, *_HTTP_1_1,
20 *_HTTP_1_0, *_wsgi_input, *_close, *_0, *_empty_string;
17 PyObject *_REMOTE_ADDR, *_PATH_INFO, *_QUERY_STRING,
18 *_HTTP_FRAGMENT, *_REQUEST_METHOD, *_SERVER_PROTOCOL,
19 *_GET, *_HTTP_1_1, *_HTTP_1_0, *_Content_Length, *_Content_Type,
20 *_Connection, *_wsgi_input, *_close, *_0, *_empty_string;
2121
2222 #ifdef DEBUG
2323 #define DBG_REQ(request, ...) \
126126 return 0;
127127 }
128128
129 static int on_url(http_parser* parser,
130 const char* url_start,
131 const size_t url_len) {
132 _set_header_free_value(
133 _REQUEST_URI,
134 PyString_FromStringAndSize(url_start, url_len)
135 );
136 return 0;
137 }
138
139129 static int on_fragment(http_parser* parser,
140130 const char* fragm_start,
141131 const size_t fragm_len) {
214204
215205 static int on_message_complete(http_parser* parser)
216206 {
217 /* SERVER_PROTOCOL */
207 /* SERVER_PROTOCOL (REQUEST_PROTOCOL) */
218208 _set_header(_SERVER_PROTOCOL, parser->http_minor == 1 ? _HTTP_1_1 : _HTTP_1_0);
219209 /* REQUEST_METHOD */
220210 if(parser->method == HTTP_GET) {
280270 .on_message_begin = on_message_begin,
281271 .on_path = on_path,
282272 .on_query_string = on_query_string,
283 .on_url = on_url,
273 .on_url = NULL,
284274 .on_fragment = on_fragment,
285275 .on_header_field = on_header_field,
286276 .on_header_value = on_header_value,