http_parser.rb 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,395 +0,0 @@
1
- [
2
- {
3
- "name": "google 301",
4
- "type": "HTTP_RESPONSE",
5
- "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\nX-$PrototypeBI-Version: 1.6.0.3\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",
6
- "should_keep_alive": true,
7
- "message_complete_on_eof": false,
8
- "http_major": 1,
9
- "http_minor": 1,
10
- "status_code": 301,
11
- "status": "Moved Permanently",
12
- "num_headers": 8,
13
- "headers": {
14
- "Location": "http://www.google.com/",
15
- "Content-Type": "text/html; charset=UTF-8",
16
- "Date": "Sun, 26 Apr 2009 11:11:49 GMT",
17
- "Expires": "Tue, 26 May 2009 11:11:49 GMT",
18
- "X-$PrototypeBI-Version": "1.6.0.3",
19
- "Cache-Control": "public, max-age=2592000",
20
- "Server": "gws",
21
- "Content-Length": "219 "
22
- },
23
- "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",
24
- "strict": true
25
- },
26
- {
27
- "name": "no content-length response",
28
- "type": "HTTP_RESPONSE",
29
- "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>",
30
- "should_keep_alive": false,
31
- "message_complete_on_eof": true,
32
- "http_major": 1,
33
- "http_minor": 1,
34
- "status_code": 200,
35
- "status": "OK",
36
- "num_headers": 5,
37
- "headers": {
38
- "Date": "Tue, 04 Aug 2009 07:59:32 GMT",
39
- "Server": "Apache",
40
- "X-Powered-By": "Servlet/2.5 JSP/2.1",
41
- "Content-Type": "text/xml; charset=utf-8",
42
- "Connection": "close"
43
- },
44
- "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>",
45
- "strict": true
46
- },
47
- {
48
- "name": "404 no headers no body",
49
- "type": "HTTP_RESPONSE",
50
- "raw": "HTTP/1.1 404 Not Found\r\n\r\n",
51
- "should_keep_alive": false,
52
- "message_complete_on_eof": true,
53
- "http_major": 1,
54
- "http_minor": 1,
55
- "status_code": 404,
56
- "status": "Not Found",
57
- "num_headers": 0,
58
- "headers": {
59
-
60
- },
61
- "body_size": 0,
62
- "body": "",
63
- "strict": true
64
- },
65
- {
66
- "name": "301 no response phrase",
67
- "type": "HTTP_RESPONSE",
68
- "raw": "HTTP/1.1 301\r\n\r\n",
69
- "should_keep_alive": false,
70
- "message_complete_on_eof": true,
71
- "http_major": 1,
72
- "http_minor": 1,
73
- "status_code": 301,
74
- "status": "",
75
- "num_headers": 0,
76
- "headers": {
77
-
78
- },
79
- "body": "",
80
- "strict": true
81
- },
82
- {
83
- "name": "200 trailing space on chunked body",
84
- "type": "HTTP_RESPONSE",
85
- "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",
86
- "should_keep_alive": true,
87
- "message_complete_on_eof": false,
88
- "http_major": 1,
89
- "http_minor": 1,
90
- "status_code": 200,
91
- "status": "OK",
92
- "num_headers": 2,
93
- "headers": {
94
- "Content-Type": "text/plain",
95
- "Transfer-Encoding": "chunked"
96
- },
97
- "body_size": 65,
98
- "body": "This is the data in the first chunk\r\nand this is the second one\r\n",
99
- "strict": true
100
- },
101
- {
102
- "name": "no carriage ret",
103
- "type": "HTTP_RESPONSE",
104
- "raw": "HTTP/1.1 200 OK\nContent-Type: text/html; charset=utf-8\nConnection: close\n\nthese headers are from http://news.ycombinator.com/",
105
- "should_keep_alive": false,
106
- "message_complete_on_eof": true,
107
- "http_major": 1,
108
- "http_minor": 1,
109
- "status_code": 200,
110
- "status": "OK",
111
- "num_headers": 2,
112
- "headers": {
113
- "Content-Type": "text/html; charset=utf-8",
114
- "Connection": "close"
115
- },
116
- "body": "these headers are from http://news.ycombinator.com/",
117
- "strict": true
118
- },
119
- {
120
- "name": "proxy connection",
121
- "type": "HTTP_RESPONSE",
122
- "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",
123
- "should_keep_alive": false,
124
- "message_complete_on_eof": false,
125
- "http_major": 1,
126
- "http_minor": 1,
127
- "status_code": 200,
128
- "status": "OK",
129
- "num_headers": 4,
130
- "headers": {
131
- "Content-Type": "text/html; charset=UTF-8",
132
- "Content-Length": "11",
133
- "Proxy-Connection": "close",
134
- "Date": "Thu, 31 Dec 2009 20:55:48 +0000"
135
- },
136
- "body": "hello world",
137
- "strict": true
138
- },
139
- {
140
- "name": "underscore header key",
141
- "type": "HTTP_RESPONSE",
142
- "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",
143
- "should_keep_alive": true,
144
- "message_complete_on_eof": false,
145
- "http_major": 1,
146
- "http_minor": 1,
147
- "status_code": 200,
148
- "status": "OK",
149
- "num_headers": 4,
150
- "headers": {
151
- "Server": "DCLK-AdSvr",
152
- "Content-Type": "text/xml",
153
- "Content-Length": "0",
154
- "DCLK_imp": "v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o"
155
- },
156
- "body": "",
157
- "strict": true
158
- },
159
- {
160
- "name": "bonjourmadame.fr",
161
- "type": "HTTP_RESPONSE",
162
- "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",
163
- "should_keep_alive": true,
164
- "message_complete_on_eof": false,
165
- "http_major": 1,
166
- "http_minor": 0,
167
- "status_code": 301,
168
- "status": "Moved Permanently",
169
- "num_headers": 9,
170
- "headers": {
171
- "Date": "Thu, 03 Jun 2010 09:56:32 GMT",
172
- "Server": "Apache/2.2.3 (Red Hat)",
173
- "Cache-Control": "public",
174
- "Pragma": "",
175
- "Location": "http://www.bonjourmadame.fr/",
176
- "Vary": "Accept-Encoding",
177
- "Content-Length": "0",
178
- "Content-Type": "text/html; charset=UTF-8",
179
- "Connection": "keep-alive"
180
- },
181
- "body": "",
182
- "strict": true
183
- },
184
- {
185
- "name": "field underscore",
186
- "type": "HTTP_RESPONSE",
187
- "raw": "HTTP/1.1 200 OK\r\nDate: Tue, 28 Sep 2010 01:14:13 GMT\r\nServer: Apache\r\nCache-Control: no-cache, must-revalidate\r\nExpires: Mon, 26 Jul 1997 05:00:00 GMT\r\n.et-Cookie: PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com\r\nVary: Accept-Encoding\r\n_eep-Alive: timeout=45\r\n_onnection: Keep-Alive\r\nTransfer-Encoding: chunked\r\nContent-Type: text/html\r\nConnection: close\r\n\r\n0\r\n\r\n",
188
- "should_keep_alive": false,
189
- "message_complete_on_eof": false,
190
- "http_major": 1,
191
- "http_minor": 1,
192
- "status_code": 200,
193
- "status": "OK",
194
- "num_headers": 11,
195
- "headers": {
196
- "Date": "Tue, 28 Sep 2010 01:14:13 GMT",
197
- "Server": "Apache",
198
- "Cache-Control": "no-cache, must-revalidate",
199
- "Expires": "Mon, 26 Jul 1997 05:00:00 GMT",
200
- ".et-Cookie": "PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com",
201
- "Vary": "Accept-Encoding",
202
- "_eep-Alive": "timeout=45",
203
- "_onnection": "Keep-Alive",
204
- "Transfer-Encoding": "chunked",
205
- "Content-Type": "text/html",
206
- "Connection": "close"
207
- },
208
- "body": "",
209
- "strict": true
210
- },
211
- {
212
- "name": "non-ASCII in status line",
213
- "type": "HTTP_RESPONSE",
214
- "raw": "HTTP/1.1 500 Oriëntatieprobleem\r\nDate: Fri, 5 Nov 2010 23:07:12 GMT+2\r\nContent-Length: 0\r\nConnection: close\r\n\r\n",
215
- "should_keep_alive": false,
216
- "message_complete_on_eof": false,
217
- "http_major": 1,
218
- "http_minor": 1,
219
- "status_code": 500,
220
- "status": "Oriëntatieprobleem",
221
- "num_headers": 3,
222
- "headers": {
223
- "Date": "Fri, 5 Nov 2010 23:07:12 GMT+2",
224
- "Content-Length": "0",
225
- "Connection": "close"
226
- },
227
- "body": "",
228
- "strict": true
229
- },
230
- {
231
- "name": "http version 0.9",
232
- "type": "HTTP_RESPONSE",
233
- "raw": "HTTP/0.9 200 OK\r\n\r\n",
234
- "should_keep_alive": false,
235
- "message_complete_on_eof": true,
236
- "http_major": 0,
237
- "http_minor": 9,
238
- "status_code": 200,
239
- "status": "OK",
240
- "num_headers": 0,
241
- "headers": {
242
-
243
- },
244
- "body": "",
245
- "strict": true
246
- },
247
- {
248
- "name": "neither content-length nor transfer-encoding response",
249
- "type": "HTTP_RESPONSE",
250
- "raw": "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\nhello world",
251
- "should_keep_alive": false,
252
- "message_complete_on_eof": true,
253
- "http_major": 1,
254
- "http_minor": 1,
255
- "status_code": 200,
256
- "status": "OK",
257
- "num_headers": 1,
258
- "headers": {
259
- "Content-Type": "text/plain"
260
- },
261
- "body": "hello world",
262
- "strict": true
263
- },
264
- {
265
- "name": "HTTP/1.0 with keep-alive and EOF-terminated 200 status",
266
- "type": "HTTP_RESPONSE",
267
- "raw": "HTTP/1.0 200 OK\r\nConnection: keep-alive\r\n\r\n",
268
- "should_keep_alive": false,
269
- "message_complete_on_eof": true,
270
- "http_major": 1,
271
- "http_minor": 0,
272
- "status_code": 200,
273
- "status": "OK",
274
- "num_headers": 1,
275
- "headers": {
276
- "Connection": "keep-alive"
277
- },
278
- "body_size": 0,
279
- "body": "",
280
- "strict": true
281
- },
282
- {
283
- "name": "HTTP/1.0 with keep-alive and a 204 status",
284
- "type": "HTTP_RESPONSE",
285
- "raw": "HTTP/1.0 204 No content\r\nConnection: keep-alive\r\n\r\n",
286
- "should_keep_alive": true,
287
- "message_complete_on_eof": false,
288
- "http_major": 1,
289
- "http_minor": 0,
290
- "status_code": 204,
291
- "status": "No content",
292
- "num_headers": 1,
293
- "headers": {
294
- "Connection": "keep-alive"
295
- },
296
- "body_size": 0,
297
- "body": "",
298
- "strict": true
299
- },
300
- {
301
- "name": "HTTP/1.1 with an EOF-terminated 200 status",
302
- "type": "HTTP_RESPONSE",
303
- "raw": "HTTP/1.1 200 OK\r\n\r\n",
304
- "should_keep_alive": false,
305
- "message_complete_on_eof": true,
306
- "http_major": 1,
307
- "http_minor": 1,
308
- "status_code": 200,
309
- "status": "OK",
310
- "num_headers": 0,
311
- "headers": {
312
-
313
- },
314
- "body_size": 0,
315
- "body": "",
316
- "strict": true
317
- },
318
- {
319
- "name": "HTTP/1.1 with a 204 status",
320
- "type": "HTTP_RESPONSE",
321
- "raw": "HTTP/1.1 204 No content\r\n\r\n",
322
- "should_keep_alive": true,
323
- "message_complete_on_eof": false,
324
- "http_major": 1,
325
- "http_minor": 1,
326
- "status_code": 204,
327
- "status": "No content",
328
- "num_headers": 0,
329
- "headers": {
330
-
331
- },
332
- "body_size": 0,
333
- "body": "",
334
- "strict": true
335
- },
336
- {
337
- "name": "HTTP/1.1 with a 204 status and keep-alive disabled",
338
- "type": "HTTP_RESPONSE",
339
- "raw": "HTTP/1.1 204 No content\r\nConnection: close\r\n\r\n",
340
- "should_keep_alive": false,
341
- "message_complete_on_eof": false,
342
- "http_major": 1,
343
- "http_minor": 1,
344
- "status_code": 204,
345
- "status": "No content",
346
- "num_headers": 1,
347
- "headers": {
348
- "Connection": "close"
349
- },
350
- "body_size": 0,
351
- "body": "",
352
- "strict": true
353
- },
354
- {
355
- "name": "HTTP/1.1 with chunked endocing and a 200 response",
356
- "type": "HTTP_RESPONSE",
357
- "raw": "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\n",
358
- "should_keep_alive": true,
359
- "message_complete_on_eof": false,
360
- "http_major": 1,
361
- "http_minor": 1,
362
- "status_code": 200,
363
- "status": "OK",
364
- "num_headers": 1,
365
- "headers": {
366
- "Transfer-Encoding": "chunked"
367
- },
368
- "body_size": 0,
369
- "body": "",
370
- "strict": true
371
- },
372
- {
373
- "name": "field space",
374
- "type": "HTTP_RESPONSE",
375
- "strict": false,
376
- "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>",
377
- "should_keep_alive": true,
378
- "message_complete_on_eof": false,
379
- "http_major": 1,
380
- "http_minor": 1,
381
- "status_code": 200,
382
- "status": "OK",
383
- "num_headers": 7,
384
- "headers": {
385
- "Server": "Microsoft-IIS/6.0",
386
- "X-Powered-By": "ASP.NET",
387
- "en-US Content-Type": "text/xml",
388
- "Content-Type": "text/xml",
389
- "Content-Length": "16",
390
- "Date": "Fri, 23 Jul 2010 18:45:38 GMT",
391
- "Connection": "keep-alive"
392
- },
393
- "body": "<xml>hello</xml>"
394
- }
395
- ]