http_parser.rb 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/.gitignore +11 -0
  2. data/.gitmodules +6 -0
  3. data/README.md +45 -0
  4. data/Rakefile +6 -0
  5. data/bench/thin.rb +57 -0
  6. data/ext/ruby_http_parser/.gitignore +1 -0
  7. data/ext/ruby_http_parser/RubyHttpParserService.java +18 -0
  8. data/ext/ruby_http_parser/ext_help.h +18 -0
  9. data/ext/ruby_http_parser/extconf.rb +16 -0
  10. data/ext/ruby_http_parser/org/ruby_http_parser/RubyHttpParser.java +403 -0
  11. data/ext/ruby_http_parser/ruby_http_parser.c +474 -0
  12. data/ext/ruby_http_parser/vendor/.gitkeep +0 -0
  13. data/ext/ruby_http_parser/vendor/http-parser-java/CONTRIBUTIONS +4 -0
  14. data/ext/ruby_http_parser/vendor/http-parser-java/LICENSE-MIT +19 -0
  15. data/ext/ruby_http_parser/vendor/http-parser-java/README.md +171 -0
  16. data/ext/ruby_http_parser/vendor/http-parser-java/TODO +19 -0
  17. data/ext/ruby_http_parser/vendor/http-parser-java/compile +1 -0
  18. data/ext/ruby_http_parser/vendor/http-parser-java/http_parser.c +1590 -0
  19. data/ext/ruby_http_parser/vendor/http-parser-java/http_parser.h +167 -0
  20. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPException.java +7 -0
  21. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPMethod.java +90 -0
  22. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPParser.java +31 -0
  23. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/ParserType.java +13 -0
  24. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/HTTPCallback.java +5 -0
  25. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/HTTPDataCallback.java +25 -0
  26. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/HTTPErrorCallback.java +7 -0
  27. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/HTTPParser.java +1894 -0
  28. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/ParserSettings.java +78 -0
  29. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/Util.java +112 -0
  30. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/TestLoaderNG.java +487 -0
  31. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/UnitTest.java +115 -0
  32. data/ext/ruby_http_parser/vendor/http-parser-java/test.c +1865 -0
  33. data/ext/ruby_http_parser/vendor/http-parser-java/test_permutations +1 -0
  34. data/ext/ruby_http_parser/vendor/http-parser-java/test_unit +1 -0
  35. data/ext/ruby_http_parser/vendor/http-parser-java/tests.dumped +539 -0
  36. data/ext/ruby_http_parser/vendor/http-parser-java/tools/byte_constants.rb +6 -0
  37. data/ext/ruby_http_parser/vendor/http-parser-java/tools/const_char.rb +13 -0
  38. data/ext/ruby_http_parser/vendor/http-parser-java/tools/lowcase.rb +15 -0
  39. data/ext/ruby_http_parser/vendor/http-parser-java/tools/parse_tests.rb +33 -0
  40. data/ext/ruby_http_parser/vendor/http-parser/CONTRIBUTIONS +4 -0
  41. data/ext/ruby_http_parser/vendor/http-parser/LICENSE-MIT +19 -0
  42. data/ext/ruby_http_parser/vendor/http-parser/README.md +171 -0
  43. data/ext/ruby_http_parser/vendor/http-parser/http_parser.c +1590 -0
  44. data/ext/ruby_http_parser/vendor/http-parser/http_parser.h +167 -0
  45. data/ext/ruby_http_parser/vendor/http-parser/test.c +1755 -0
  46. data/http_parser.rb.gemspec +15 -0
  47. data/lib/http/parser.rb +1 -0
  48. data/lib/http_parser.rb +4 -0
  49. data/spec/parser_spec.rb +187 -0
  50. data/spec/spec_helper.rb +2 -0
  51. data/spec/support/requests.json +381 -0
  52. data/spec/support/responses.json +186 -0
  53. data/tasks/compile.rake +39 -0
  54. data/tasks/spec.rake +5 -0
  55. data/tasks/submodules.rake +7 -0
  56. metadata +121 -0
@@ -0,0 +1 @@
1
+ javac -d classes/ `find src -name '*.java'` && java -cp classes http_parser.lolevel.TestLoaderNG tests.dumped
@@ -0,0 +1 @@
1
+ javac -d classes/ `find src -name '*.java'` && java -cp classes http_parser.lolevel.UnitTest
@@ -0,0 +1,539 @@
1
+ name :curl get
2
+ raw :"GET /test HTTP/1.1\r\nUser-Agent: curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1\r\nHost: 0.0.0.0=5000\r\nAccept: */*\r\n\r\n"
3
+ type :HTTP_REQUEST
4
+ method: HTTP_GET
5
+ status_code :0
6
+ request_path:/test
7
+ request_url :/test
8
+ fragment :
9
+ query_string:
10
+ body :""
11
+ body_size :0
12
+ header_0 :{ "User-Agent": "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1"}
13
+ header_1 :{ "Host": "0.0.0.0=5000"}
14
+ header_2 :{ "Accept": "*/*"}
15
+ should_keep_alive :1
16
+ upgrade :0
17
+ http_major :1
18
+ http_minor :1
19
+
20
+ name :firefox get
21
+ raw :"GET /favicon.ico HTTP/1.1\r\nHost: 0.0.0.0=5000\r\nUser-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nAccept-Encoding: gzip,deflate\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nKeep-Alive: 300\r\nConnection: keep-alive\r\n\r\n"
22
+ type :HTTP_REQUEST
23
+ method: HTTP_GET
24
+ status_code :0
25
+ request_path:/favicon.ico
26
+ request_url :/favicon.ico
27
+ fragment :
28
+ query_string:
29
+ body :""
30
+ body_size :0
31
+ header_0 :{ "Host": "0.0.0.0=5000"}
32
+ header_1 :{ "User-Agent": "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0"}
33
+ header_2 :{ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}
34
+ header_3 :{ "Accept-Language": "en-us,en;q=0.5"}
35
+ header_4 :{ "Accept-Encoding": "gzip,deflate"}
36
+ header_5 :{ "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7"}
37
+ header_6 :{ "Keep-Alive": "300"}
38
+ header_7 :{ "Connection": "keep-alive"}
39
+ should_keep_alive :1
40
+ upgrade :0
41
+ http_major :1
42
+ http_minor :1
43
+
44
+ name :dumbfuck
45
+ raw :"GET /dumbfuck HTTP/1.1\r\naaaaaaaaaaaaa:++++++++++\r\n\r\n"
46
+ type :HTTP_REQUEST
47
+ method: HTTP_GET
48
+ status_code :0
49
+ request_path:/dumbfuck
50
+ request_url :/dumbfuck
51
+ fragment :
52
+ query_string:
53
+ body :""
54
+ body_size :0
55
+ header_0 :{ "aaaaaaaaaaaaa": "++++++++++"}
56
+ should_keep_alive :1
57
+ upgrade :0
58
+ http_major :1
59
+ http_minor :1
60
+
61
+ name :fragment in url
62
+ raw :"GET /forums/1/topics/2375?page=1#posts-17408 HTTP/1.1\r\n\r\n"
63
+ type :HTTP_REQUEST
64
+ method: HTTP_GET
65
+ status_code :0
66
+ request_path:/forums/1/topics/2375
67
+ request_url :/forums/1/topics/2375?page=1#posts-17408
68
+ fragment :posts-17408
69
+ query_string:page=1
70
+ body :""
71
+ body_size :0
72
+ should_keep_alive :1
73
+ upgrade :0
74
+ http_major :1
75
+ http_minor :1
76
+
77
+ name :get no headers no body
78
+ raw :"GET /get_no_headers_no_body/world HTTP/1.1\r\n\r\n"
79
+ type :HTTP_REQUEST
80
+ method: HTTP_GET
81
+ status_code :0
82
+ request_path:/get_no_headers_no_body/world
83
+ request_url :/get_no_headers_no_body/world
84
+ fragment :
85
+ query_string:
86
+ body :""
87
+ body_size :0
88
+ should_keep_alive :1
89
+ upgrade :0
90
+ http_major :1
91
+ http_minor :1
92
+
93
+ name :get one header no body
94
+ raw :"GET /get_one_header_no_body HTTP/1.1\r\nAccept: */*\r\n\r\n"
95
+ type :HTTP_REQUEST
96
+ method: HTTP_GET
97
+ status_code :0
98
+ request_path:/get_one_header_no_body
99
+ request_url :/get_one_header_no_body
100
+ fragment :
101
+ query_string:
102
+ body :""
103
+ body_size :0
104
+ header_0 :{ "Accept": "*/*"}
105
+ should_keep_alive :1
106
+ upgrade :0
107
+ http_major :1
108
+ http_minor :1
109
+
110
+ name :get funky content length body hello
111
+ raw :"GET /get_funky_content_length_body_hello HTTP/1.0\r\nconTENT-Length: 5\r\n\r\nHELLO"
112
+ type :HTTP_REQUEST
113
+ method: HTTP_GET
114
+ status_code :0
115
+ request_path:/get_funky_content_length_body_hello
116
+ request_url :/get_funky_content_length_body_hello
117
+ fragment :
118
+ query_string:
119
+ body :"HELLO"
120
+ body_size :0
121
+ header_0 :{ "conTENT-Length": "5"}
122
+ should_keep_alive :0
123
+ upgrade :0
124
+ http_major :1
125
+ http_minor :0
126
+
127
+ name :post identity body world
128
+ raw :"POST /post_identity_body_world?q=search#hey HTTP/1.1\r\nAccept: */*\r\nTransfer-Encoding: identity\r\nContent-Length: 5\r\n\r\nWorld"
129
+ type :HTTP_REQUEST
130
+ method: HTTP_POST
131
+ status_code :0
132
+ request_path:/post_identity_body_world
133
+ request_url :/post_identity_body_world?q=search#hey
134
+ fragment :hey
135
+ query_string:q=search
136
+ body :"World"
137
+ body_size :0
138
+ header_0 :{ "Accept": "*/*"}
139
+ header_1 :{ "Transfer-Encoding": "identity"}
140
+ header_2 :{ "Content-Length": "5"}
141
+ should_keep_alive :1
142
+ upgrade :0
143
+ http_major :1
144
+ http_minor :1
145
+
146
+ name :post - chunked body: all your base are belong to us
147
+ raw :"POST /post_chunked_all_your_base HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n1e\r\nall your base are belong to us\r\n0\r\n\r\n"
148
+ type :HTTP_REQUEST
149
+ method: HTTP_POST
150
+ status_code :0
151
+ request_path:/post_chunked_all_your_base
152
+ request_url :/post_chunked_all_your_base
153
+ fragment :
154
+ query_string:
155
+ body :"all your base are belong to us"
156
+ body_size :0
157
+ header_0 :{ "Transfer-Encoding": "chunked"}
158
+ should_keep_alive :1
159
+ upgrade :0
160
+ http_major :1
161
+ http_minor :1
162
+
163
+ name :two chunks ; triple zero ending
164
+ raw :"POST /two_chunks_mult_zero_end HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n5\r\nhello\r\n6\r\n world\r\n000\r\n\r\n"
165
+ type :HTTP_REQUEST
166
+ method: HTTP_POST
167
+ status_code :0
168
+ request_path:/two_chunks_mult_zero_end
169
+ request_url :/two_chunks_mult_zero_end
170
+ fragment :
171
+ query_string:
172
+ body :"hello world"
173
+ body_size :0
174
+ header_0 :{ "Transfer-Encoding": "chunked"}
175
+ should_keep_alive :1
176
+ upgrade :0
177
+ http_major :1
178
+ http_minor :1
179
+
180
+ name :chunked with trailing headers. blech.
181
+ raw :"POST /chunked_w_trailing_headers HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n5\r\nhello\r\n6\r\n world\r\n0\r\nVary: *\r\nContent-Type: text/plain\r\n\r\n"
182
+ type :HTTP_REQUEST
183
+ method: HTTP_POST
184
+ status_code :0
185
+ request_path:/chunked_w_trailing_headers
186
+ request_url :/chunked_w_trailing_headers
187
+ fragment :
188
+ query_string:
189
+ body :"hello world"
190
+ body_size :0
191
+ header_0 :{ "Transfer-Encoding": "chunked"}
192
+ header_1 :{ "Vary": "*"}
193
+ header_2 :{ "Content-Type": "text/plain"}
194
+ should_keep_alive :1
195
+ upgrade :0
196
+ http_major :1
197
+ http_minor :1
198
+
199
+ name :with bullshit after the length
200
+ raw :"POST /chunked_w_bullshit_after_length HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n5; ihatew3;whatthefuck=aretheseparametersfor\r\nhello\r\n6; blahblah; blah\r\n world\r\n0\r\n\r\n"
201
+ type :HTTP_REQUEST
202
+ method: HTTP_POST
203
+ status_code :0
204
+ request_path:/chunked_w_bullshit_after_length
205
+ request_url :/chunked_w_bullshit_after_length
206
+ fragment :
207
+ query_string:
208
+ body :"hello world"
209
+ body_size :0
210
+ header_0 :{ "Transfer-Encoding": "chunked"}
211
+ should_keep_alive :1
212
+ upgrade :0
213
+ http_major :1
214
+ http_minor :1
215
+
216
+ name :with quotes
217
+ raw :"GET /with_\"stupid\"_quotes?foo=\"bar\" HTTP/1.1\r\n\r\n"
218
+ type :HTTP_REQUEST
219
+ method: HTTP_GET
220
+ status_code :0
221
+ request_path:/with_"stupid"_quotes
222
+ request_url :/with_"stupid"_quotes?foo="bar"
223
+ fragment :
224
+ query_string:foo="bar"
225
+ body :""
226
+ body_size :0
227
+ should_keep_alive :1
228
+ upgrade :0
229
+ http_major :1
230
+ http_minor :1
231
+
232
+ name :apachebench get
233
+ raw :"GET /test HTTP/1.0\r\nHost: 0.0.0.0:5000\r\nUser-Agent: ApacheBench/2.3\r\nAccept: */*\r\n\r\n"
234
+ type :HTTP_REQUEST
235
+ method: HTTP_GET
236
+ status_code :0
237
+ request_path:/test
238
+ request_url :/test
239
+ fragment :
240
+ query_string:
241
+ body :""
242
+ body_size :0
243
+ header_0 :{ "Host": "0.0.0.0:5000"}
244
+ header_1 :{ "User-Agent": "ApacheBench/2.3"}
245
+ header_2 :{ "Accept": "*/*"}
246
+ should_keep_alive :0
247
+ upgrade :0
248
+ http_major :1
249
+ http_minor :0
250
+
251
+ name :query url with question mark
252
+ raw :"GET /test.cgi?foo=bar?baz HTTP/1.1\r\n\r\n"
253
+ type :HTTP_REQUEST
254
+ method: HTTP_GET
255
+ status_code :0
256
+ request_path:/test.cgi
257
+ request_url :/test.cgi?foo=bar?baz
258
+ fragment :
259
+ query_string:foo=bar?baz
260
+ body :""
261
+ body_size :0
262
+ should_keep_alive :1
263
+ upgrade :0
264
+ http_major :1
265
+ http_minor :1
266
+
267
+ name :newline prefix get
268
+ raw :"\r\nGET /test HTTP/1.1\r\n\r\n"
269
+ type :HTTP_REQUEST
270
+ method: HTTP_GET
271
+ status_code :0
272
+ request_path:/test
273
+ request_url :/test
274
+ fragment :
275
+ query_string:
276
+ body :""
277
+ body_size :0
278
+ should_keep_alive :1
279
+ upgrade :0
280
+ http_major :1
281
+ http_minor :1
282
+
283
+ name :upgrade request
284
+ raw :"GET /demo HTTP/1.1\r\nHost: example.com\r\nConnection: Upgrade\r\nSec-WebSocket-Key2: 12998 5 Y3 1 .P00\r\nSec-WebSocket-Protocol: sample\r\nUpgrade: WebSocket\r\nSec-WebSocket-Key1: 4 @1 46546xW%0l 1 5\r\nOrigin: http://example.com\r\n\r\n"
285
+ type :HTTP_REQUEST
286
+ method: HTTP_GET
287
+ status_code :0
288
+ request_path:/demo
289
+ request_url :/demo
290
+ fragment :
291
+ query_string:
292
+ body :""
293
+ body_size :0
294
+ header_0 :{ "Host": "example.com"}
295
+ header_1 :{ "Connection": "Upgrade"}
296
+ header_2 :{ "Sec-WebSocket-Key2": "12998 5 Y3 1 .P00"}
297
+ header_3 :{ "Sec-WebSocket-Protocol": "sample"}
298
+ header_4 :{ "Upgrade": "WebSocket"}
299
+ header_5 :{ "Sec-WebSocket-Key1": "4 @1 46546xW%0l 1 5"}
300
+ header_6 :{ "Origin": "http://example.com"}
301
+ should_keep_alive :1
302
+ upgrade :1
303
+ http_major :1
304
+ http_minor :1
305
+
306
+ name :connect request
307
+ raw :"CONNECT home.netscape.com:443 HTTP/1.0\r\nUser-agent: Mozilla/1.1N\r\nProxy-authorization: basic aGVsbG86d29ybGQ=\r\n\r\n"
308
+ type :HTTP_REQUEST
309
+ method: HTTP_CONNECT
310
+ status_code :0
311
+ request_path:
312
+ request_url :home.netscape.com:443
313
+ fragment :
314
+ query_string:
315
+ body :""
316
+ body_size :0
317
+ header_0 :{ "User-agent": "Mozilla/1.1N"}
318
+ header_1 :{ "Proxy-authorization": "basic aGVsbG86d29ybGQ="}
319
+ should_keep_alive :0
320
+ upgrade :1
321
+ http_major :1
322
+ http_minor :0
323
+
324
+ name :report request
325
+ raw :"REPORT /test HTTP/1.1\r\n\r\n"
326
+ type :HTTP_REQUEST
327
+ method: REPORT
328
+ status_code :0
329
+ request_path:/test
330
+ request_url :/test
331
+ fragment :
332
+ query_string:
333
+ body :""
334
+ body_size :0
335
+ should_keep_alive :1
336
+ upgrade :0
337
+ http_major :1
338
+ http_minor :1
339
+
340
+ name :google 301
341
+ raw :"HTTP/1.1 301 Moved Permanently\r\nLocation: http://www.google.com/\r\nContent-Type: text/html; charset=UTF-8\r\nDate: Sun, 26 Apr 2009 11:11:49 GMT\r\nExpires: Tue, 26 May 2009 11:11:49 GMT\r\nCache-Control: public, max-age=2592000\r\nServer: gws\r\nContent-Length: 219\r\n\r\n<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n<TITLE>301 Moved</TITLE></HEAD><BODY>\n<H1>301 Moved</H1>\nThe document has moved\n<A HREF=\"http://www.google.com/\">here</A>.\r\n</BODY></HTML>\r\n"
342
+ type :HTTP_RESPONSE
343
+ method: HTTP_DELETE
344
+ status_code :301
345
+ request_path:
346
+ request_url :
347
+ fragment :
348
+ query_string:
349
+ body :"<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n<TITLE>301 Moved</TITLE></HEAD><BODY>\n<H1>301 Moved</H1>\nThe document has moved\n<A HREF=\"http://www.google.com/\">here</A>.\r\n</BODY></HTML>\r\n"
350
+ body_size :0
351
+ header_0 :{ "Location": "http://www.google.com/"}
352
+ header_1 :{ "Content-Type": "text/html; charset=UTF-8"}
353
+ header_2 :{ "Date": "Sun, 26 Apr 2009 11:11:49 GMT"}
354
+ header_3 :{ "Expires": "Tue, 26 May 2009 11:11:49 GMT"}
355
+ header_4 :{ "Cache-Control": "public, max-age=2592000"}
356
+ header_5 :{ "Server": "gws"}
357
+ header_6 :{ "Content-Length": "219"}
358
+ should_keep_alive :1
359
+ upgrade :0
360
+ http_major :1
361
+ http_minor :1
362
+
363
+ name :no content-length response
364
+ raw :"HTTP/1.1 200 OK\r\nDate: Tue, 04 Aug 2009 07:59:32 GMT\r\nServer: Apache\r\nX-Powered-By: Servlet/2.5 JSP/2.1\r\nContent-Type: text/xml; charset=utf-8\r\nConnection: close\r\n\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <SOAP-ENV:Body>\n <SOAP-ENV:Fault>\n <faultcode>SOAP-ENV:Client</faultcode>\n <faultstring>Client Error</faultstring>\n </SOAP-ENV:Fault>\n </SOAP-ENV:Body>\n</SOAP-ENV:Envelope>"
365
+ type :HTTP_RESPONSE
366
+ method: HTTP_DELETE
367
+ status_code :200
368
+ request_path:
369
+ request_url :
370
+ fragment :
371
+ query_string:
372
+ body :"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <SOAP-ENV:Body>\n <SOAP-ENV:Fault>\n <faultcode>SOAP-ENV:Client</faultcode>\n <faultstring>Client Error</faultstring>\n </SOAP-ENV:Fault>\n </SOAP-ENV:Body>\n</SOAP-ENV:Envelope>"
373
+ body_size :0
374
+ header_0 :{ "Date": "Tue, 04 Aug 2009 07:59:32 GMT"}
375
+ header_1 :{ "Server": "Apache"}
376
+ header_2 :{ "X-Powered-By": "Servlet/2.5 JSP/2.1"}
377
+ header_3 :{ "Content-Type": "text/xml; charset=utf-8"}
378
+ header_4 :{ "Connection": "close"}
379
+ should_keep_alive :0
380
+ upgrade :0
381
+ http_major :1
382
+ http_minor :1
383
+
384
+ name :404 no headers no body
385
+ raw :"HTTP/1.1 404 Not Found\r\n\r\n"
386
+ type :HTTP_RESPONSE
387
+ method: HTTP_DELETE
388
+ status_code :404
389
+ request_path:
390
+ request_url :
391
+ fragment :
392
+ query_string:
393
+ body :""
394
+ body_size :0
395
+ should_keep_alive :1
396
+ upgrade :0
397
+ http_major :1
398
+ http_minor :1
399
+
400
+ name :301 no response phrase
401
+ raw :"HTTP/1.1 301\r\n\r\n"
402
+ type :HTTP_RESPONSE
403
+ method: HTTP_DELETE
404
+ status_code :301
405
+ request_path:
406
+ request_url :
407
+ fragment :
408
+ query_string:
409
+ body :""
410
+ body_size :0
411
+ should_keep_alive :1
412
+ upgrade :0
413
+ http_major :1
414
+ http_minor :1
415
+
416
+ name :200 trailing space on chunked body
417
+ raw :"HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nTransfer-Encoding: chunked\r\n\r\n25 \r\nThis is the data in the first chunk\r\n\r\n1C\r\nand this is the second one\r\n\r\n0 \r\n\r\n"
418
+ type :HTTP_RESPONSE
419
+ method: HTTP_DELETE
420
+ status_code :200
421
+ request_path:
422
+ request_url :
423
+ fragment :
424
+ query_string:
425
+ body :"This is the data in the first chunk\r\nand this is the second one\r\n"
426
+ body_size :65
427
+ header_0 :{ "Content-Type": "text/plain"}
428
+ header_1 :{ "Transfer-Encoding": "chunked"}
429
+ should_keep_alive :1
430
+ upgrade :0
431
+ http_major :1
432
+ http_minor :1
433
+
434
+ name :no carriage ret
435
+ raw :"HTTP/1.1 200 OK\nContent-Type: text/html; charset=utf-8\nConnection: close\n\nthese headers are from http://news.ycombinator.com/"
436
+ type :HTTP_RESPONSE
437
+ method: HTTP_DELETE
438
+ status_code :200
439
+ request_path:
440
+ request_url :
441
+ fragment :
442
+ query_string:
443
+ body :"these headers are from http://news.ycombinator.com/"
444
+ body_size :0
445
+ header_0 :{ "Content-Type": "text/html; charset=utf-8"}
446
+ header_1 :{ "Connection": "close"}
447
+ should_keep_alive :0
448
+ upgrade :0
449
+ http_major :1
450
+ http_minor :1
451
+
452
+ name :proxy connection
453
+ raw :"HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Length: 11\r\nProxy-Connection: close\r\nDate: Thu, 31 Dec 2009 20:55:48 +0000\r\n\r\nhello world"
454
+ type :HTTP_RESPONSE
455
+ method: HTTP_DELETE
456
+ status_code :200
457
+ request_path:
458
+ request_url :
459
+ fragment :
460
+ query_string:
461
+ body :"hello world"
462
+ body_size :0
463
+ header_0 :{ "Content-Type": "text/html; charset=UTF-8"}
464
+ header_1 :{ "Content-Length": "11"}
465
+ header_2 :{ "Proxy-Connection": "close"}
466
+ header_3 :{ "Date": "Thu, 31 Dec 2009 20:55:48 +0000"}
467
+ should_keep_alive :0
468
+ upgrade :0
469
+ http_major :1
470
+ http_minor :1
471
+
472
+ name :underscore header key
473
+ raw :"HTTP/1.1 200 OK\r\nServer: DCLK-AdSvr\r\nContent-Type: text/xml\r\nContent-Length: 0\r\nDCLK_imp: v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o\r\n\r\n"
474
+ type :HTTP_RESPONSE
475
+ method: HTTP_DELETE
476
+ status_code :200
477
+ request_path:
478
+ request_url :
479
+ fragment :
480
+ query_string:
481
+ body :""
482
+ body_size :0
483
+ header_0 :{ "Server": "DCLK-AdSvr"}
484
+ header_1 :{ "Content-Type": "text/xml"}
485
+ header_2 :{ "Content-Length": "0"}
486
+ header_3 :{ "DCLK_imp": "v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o"}
487
+ should_keep_alive :1
488
+ upgrade :0
489
+ http_major :1
490
+ http_minor :1
491
+
492
+ name :bonjourmadame.fr
493
+ raw :"HTTP/1.0 301 Moved Permanently\r\nDate: Thu, 03 Jun 2010 09:56:32 GMT\r\nServer: Apache/2.2.3 (Red Hat)\r\nCache-Control: public\r\nPragma: \r\nLocation: http://www.bonjourmadame.fr/\r\nVary: Accept-Encoding\r\nContent-Length: 0\r\nContent-Type: text/html; charset=UTF-8\r\nConnection: keep-alive\r\n\r\n"
494
+ type :HTTP_RESPONSE
495
+ method: HTTP_DELETE
496
+ status_code :301
497
+ request_path:
498
+ request_url :
499
+ fragment :
500
+ query_string:
501
+ body :""
502
+ body_size :0
503
+ header_0 :{ "Date": "Thu, 03 Jun 2010 09:56:32 GMT"}
504
+ header_1 :{ "Server": "Apache/2.2.3 (Red Hat)"}
505
+ header_2 :{ "Cache-Control": "public"}
506
+ header_3 :{ "Pragma": ""}
507
+ header_4 :{ "Location": "http://www.bonjourmadame.fr/"}
508
+ header_5 :{ "Vary": "Accept-Encoding"}
509
+ header_6 :{ "Content-Length": "0"}
510
+ header_7 :{ "Content-Type": "text/html; charset=UTF-8"}
511
+ header_8 :{ "Connection": "keep-alive"}
512
+ should_keep_alive :1
513
+ upgrade :0
514
+ http_major :1
515
+ http_minor :0
516
+
517
+ name :field space
518
+ raw :"HTTP/1.1 200 OK\r\nServer: Microsoft-IIS/6.0\r\nX-Powered-By: ASP.NET\r\nen-US Content-Type: text/xml\r\nContent-Type: text/xml\r\nContent-Length: 16\r\nDate: Fri, 23 Jul 2010 18:45:38 GMT\r\nConnection: keep-alive\r\n\r\n<xml>hello</xml>"
519
+ type :HTTP_RESPONSE
520
+ method: HTTP_DELETE
521
+ status_code :200
522
+ request_path:
523
+ request_url :
524
+ fragment :
525
+ query_string:
526
+ body :"<xml>hello</xml>"
527
+ body_size :0
528
+ header_0 :{ "Server": "Microsoft-IIS/6.0"}
529
+ header_1 :{ "X-Powered-By": "ASP.NET"}
530
+ header_2 :{ "en-US Content-Type": "text/xml"}
531
+ header_3 :{ "Content-Type": "text/xml"}
532
+ header_4 :{ "Content-Length": "16"}
533
+ header_5 :{ "Date": "Fri, 23 Jul 2010 18:45:38 GMT"}
534
+ header_6 :{ "Connection": "keep-alive"}
535
+ should_keep_alive :1
536
+ upgrade :0
537
+ http_major :1
538
+ http_minor :1
539
+